Link to home
Start Free TrialLog in
Avatar of Kobold
Kobold

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Kobold
Kobold

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial