MDB (ejb3) in JBoss with WebSphere MQ

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=""),
	    @ActivationConfigProperty(propertyName="port", propertyValue="1420")
public class RequestListener implements MessageDrivenBean, MessageListener {
Queue MBean:
	<!-- mbeans defining JCA administered objects -->
	<mbean code="org.jboss.resource.deployment.AdminObject"
		<attribute name="JNDIName">jms/request</attribute>
		<depends optional-attribute-name="RARName">
		<attribute name="Type">javax.jms.Queue</attribute>
		<attribute name="Properties">
Connection Factory
  <!-- JCA Connection factory definitions -->
    <xa-transaction />
      <config-property name="queueManager" type="java.lang.String">MGT0</config-property>
      <config-property name="hostName" type="java.lang.String"></config-property>
      <config-property name="port" type="java.lang.String">1420</config-property>
      <config-property name="transportType" type="java.lang.String">CLIENT</config-property>

Open in new window

Who is Participating?
KoboldConnect With a Mentor Author Commented:
I finally found something:

edit ra.xml from wmq.jmsra.rar/META-INF,  replace 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() {

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.