|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Lookup of ConnectionFactory on mdb with JBoss-7.1.2.Final |
« View previous topic :: View next topic » |
Author |
Message
|
mvoegele |
Posted: Fri Feb 15, 2013 5:52 am Post subject: Lookup of ConnectionFactory on mdb with JBoss-7.1.2.Final |
|
|
Newbie
Joined: 15 Feb 2013 Posts: 5
|
Dear all
I am using Websphere Mq 7.1.0.2-k710-002-120928 with jboss-eap-6.0.1 based on jboss-as-7.1.2.Final.
I configured ConnectionFactory and Queue in domain.xml subsystem resource-adapter in the following way:
<resource-adapter>
<archive>wmq.jmsra.rar</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/jms/MqConnectionFactorySsl" pool-name="MqConnectionFactorySslPool">
<config-property name="channel">MC.MQJMSSAMP_SSL</config-property>
<config-property name="hostName">epmqdev1</config-property>
<config-property name="port">1414</config-property>
<config-property name="queueManager">z000502A.SUN.T</config-property>
<config-property name="sslCipherSuite">SSL_RSA_WITH_RC4_128_MD5</config-property>
<config-property name="transportType">Client</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/MqJmsSampleQueue" pool-name="MqJmsSampleQueuePool">
<config-property name="baseQueueName">A.EPLATFORM.MQJMSSAMP</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
Now for a simple message sender ejb, I can lookup both ConnectionFactory and Queue using:
@Resource(name = "java:jboss/jms/MqConnectionFactorySsl")
private ConnectionFactory connectionFactory;
@Resource(name = "java:jboss/jms/MqJmsSampleQueue")
private Queue destinationQueue;
Now I defined an mdb as follows:
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "epmqdev1 "),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "MC.MQJMSSAMP"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "z000502A.SUN.T"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "Client"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/jms/MqJmsSampleQueue")})
public class MdbSampleJndi implements MessageListener {...}
For the Queue, it is possible to set useJNDI=true and enter the jndiName into the destination property.
For the ConnectionFactory, a lookup in jndi does not seem to be possible.
In order to keep all configuration in one central place (domain.xml), and to not have stage dependent values in annotations, I would like to use the configuration already present in domain.xml and thus would like to configure the mdb to also do a lookup in jndi for the ConnectionFactory.
Is there a way to achieve this?
Thanks in advance for your replies.
Regards
Michael |
|
Back to top |
|
 |
camauz |
Posted: Mon Mar 04, 2013 7:34 am Post subject: |
|
|
 Acolyte
Joined: 20 Aug 2007 Posts: 52 Location: Mojan, Italy
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Mar 04, 2013 7:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
mvoegele |
Posted: Mon Mar 04, 2013 11:02 pm Post subject: |
|
|
Newbie
Joined: 15 Feb 2013 Posts: 5
|
Dear all
First thanks for your replies.
I answered http://www.mqseries.net/phpBB2/viewtopic.php?t=63644 and yes, we are already using ejb-jar.xml and in there configure stage dependent stuff using system-properties.
Nevertheless, I still think it would be simpler if the resourcer-adapter supported the lookup of a connection-definition. For every mq job, outbound and inbound, a connection-factory and a queue is necessary, or at least a queue and some connection-definition-details. I was already in contact with red hat support. They told me that the resource-adapter would need to support that and I agree with them as jboss code just passes these activation-config-properties to the resource-adapter.
There is already a property called useJNDI, which tells the resource-adapter to use the string in destination to lookup the queue in jndi. But this is not enough, the resource-adapter should also be able to lookup the connection-definition in jndi. As I mentioned before, this would make configuration simpler and all configuration could be centralized in one place in domain.xml/standalone.xml.
Regards
Michael |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|