MDB (ejb3) in JBoss with WebSphere MQ

Hi,
Our MDB already work in our JBoss server, our problem is that the server address/port are specified in ActivationConfigProperty annotation, so it's not configurable. The queue is retrieve from the JNDI, but i cannot specify the ConnectionFactory as a JNDI ressource...

I`ve already try an annotation like:
@ActivationConfigProperty(propertyName="connectionFactoryName", propertyValue="jms/factory")

Result: No property found for: connectionFactoryName on JavaBean: javax.jms.Queue:jms/request@@localhost)

From what i read, i have very little hope to resolve this issue.

JBoss version: jboss-4.2.3.GA
Websphere MQ: 6.xx


MDB Code:
 
@MessageDriven(name="RequestListener", activationConfig = {
	    @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
	    @ActivationConfigProperty(propertyName="destination", propertyValue="jms/request"),
	    @ActivationConfigProperty(propertyName="useJNDI", propertyValue="true"),
	    @ActivationConfigProperty(propertyName="hostName", propertyValue="192.168.1.12"),
	    @ActivationConfigProperty(propertyName="port", propertyValue="1420")
	})
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class RequestListener implements MessageDrivenBean, MessageListener {
 
 
 
Queue MBean:
 
	<!-- mbeans defining JCA administered objects -->
	<mbean code="org.jboss.resource.deployment.AdminObject"
		name="jca.wmq:name=jmsRequest">
		<attribute name="JNDIName">jms/request</attribute>
		<depends optional-attribute-name="RARName">
			jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'
		</depends>
		<attribute name="Type">javax.jms.Queue</attribute>
		<attribute name="Properties">
			baseQueueName=REQUEST
			targetClient=JMS
		</attribute>
	</mbean>
 
 
 
Connection Factory
 
  <!-- JCA Connection factory definitions -->
  <tx-connection-factory>
    <jndi-name>jms/factory</jndi-name>
    <xa-transaction />
    <rar-name>wmq.jmsra.rar</rar-name>
   <connection-definition>javax.jms.ConnectionFactory</connection-definition>
      <config-property name="queueManager" type="java.lang.String">MGT0</config-property>
      <config-property name="hostName" type="java.lang.String">192.168.1.12</config-property>
      <config-property name="port" type="java.lang.String">1420</config-property>
      <config-property name="transportType" type="java.lang.String">CLIENT</config-property>
  </tx-connection-factory>

Open in new window

LVL 3
KoboldAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KoboldAuthor Commented:
I finally found something:

edit ra.xml from wmq.jmsra.rar/META-INF,  replace com.ibm.mq.connector.inbound.ActivationSpecImpl with
a custom class that extends it.

Package that class in a .jar and place it in the same directory than  wmq.jmsra.rar.

Your impl can get its parameters from a .xml, env properties or anything else.

this is a patch, but i didnt find anything else...
public class DynamicActivationSpecImpl extends ActivationSpecImpl {
 
	/**
	 * 
	 */
	public DynamicActivationSpecImpl() {
		setHostName("10.10.1.17");
		setPort(1420);
		setUseJNDI(true);
	}
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.