-
1. Re: JMS Selector support in 4.3GA
kconner Jun 20, 2008 5:06 AM (in response to mathieu)We are not aware of any issues in this area, could you send me a test case?
-
2. Re: JMS Selector support in 4.3GA
mathieu Jun 23, 2008 9:41 AM (in response to mathieu)I prepared a test case showing the problem:
It uses 5 files:
- A test client: SendJMSMessage.java
- A gateway queue : gw1-service.xml
- A aware queue : internalbus-service.xml
-A ESB archive with two files in it:
- jboss-esb.xml
- deployment.wml
(I couldn't find a way to attached them, so I will copy past:)
SendJMSMessage.javaimport java.util.Properties; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueSender; import javax.jms.QueueSession; import javax.naming.InitialContext; public class SendJMSMessage { private static final String CONNECTION_FACTORY = "ConnectionFactory"; private static final String DEFAULT_INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; private static final String DEFAULT_PROVIDER_URL = "localhost:1099"; private static final String DEFAULT_SECURITY_PRINCIPAL = "admin"; private static final String DEFAULT_SECURITY_CREDENTIALS = "password"; private static final String INITIAL_CONTEXT_FACTORY_KEY = "INITIAL_CONTEXT_FACTORY"; private static final String PROVIDER_URL_KEY = "PROVIDER_URL"; private static final String SECURITY_PRINCIPAL_KEY = "SECURITY_PRINCIPAL"; private static final String SECURITY_CREDENTIALS_KEY = "SECURITY_CREDENTIALS"; public static void main(String[] args) { try { Properties environmentProperties = new Properties(); environmentProperties.setProperty(INITIAL_CONTEXT_FACTORY_KEY, DEFAULT_INITIAL_CONTEXT_FACTORY); environmentProperties.setProperty(PROVIDER_URL_KEY, DEFAULT_PROVIDER_URL); environmentProperties.setProperty(SECURITY_PRINCIPAL_KEY, DEFAULT_SECURITY_PRINCIPAL); environmentProperties.setProperty(SECURITY_CREDENTIALS_KEY, DEFAULT_SECURITY_CREDENTIALS); SendJMSMessage sendJMSMessage = new SendJMSMessage(); sendJMSMessage.sendMessage(environmentProperties, "azerty".getBytes()); System.out.println("done"); } catch (Exception e) { e.printStackTrace(); } } protected void sendMessage(Properties environmentProperties, byte[] content) throws Exception { InitialContext iniCtx = new InitialContext(environmentProperties); Object tmp = iniCtx.lookup(CONNECTION_FACTORY); QueueConnectionFactory qcf = (QueueConnectionFactory) tmp; QueueConnection conn = qcf.createQueueConnection(); Queue que = (Queue) iniCtx.lookup("queue/gw1"); QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); conn.start(); QueueSender send = session.createSender(que); ObjectMessage tm = session.createObjectMessage(content); send.send(tm); send.close(); conn.stop(); session.close(); conn.close(); } }
gw1-service.xml<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=gw1" xmbean-dd="xmdesc/Queue-xmbean.xml"> <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends> <depends>jboss.messaging:service=PostOffice</depends> </mbean> </server>
internalbus-service.xml<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=internalbus" xmbean-dd="xmdesc/Queue-xmbean.xml"> <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends> <depends>jboss.messaging:service=PostOffice</depends> </mbean> </server>
jboss-esb.xml<?xml version="1.0" encoding="utf-8"?> <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" > <providers> <jms-provider name="gw1" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost" jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces"> <jms-bus busid="gw1"> <jms-message-filter dest-type="QUEUE" dest-name="queue/gw1"/> </jms-bus> </jms-provider> <jms-provider name="internalbus" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost" jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces"> <jms-bus busid="gw1_Aware"> <jms-message-filter dest-type="QUEUE" dest-name="queue/internalbus" selector="service='gw1Service'"/> </jms-bus> <jms-bus busid="processPipeService_Aware"> <jms-message-filter dest-type="QUEUE" dest-name="queue/internalbus" selector="service='processPipeService'"/> </jms-bus> </jms-provider> </providers> <services> <service category="ba" name="gw1Service" description="gw1Service"> <listeners> <jms-listener name="gw1" busidref="gw1" maxThreads="1" is-gateway="true" /> <jms-listener name="gw1_Aware" busidref="gw1_Aware" maxThreads="1"/> </listeners> <actions> <action name="print" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="printfull" value="true"/> </action> <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter"> <property name="destinations"> <route-to service-category="ba" service-name="processPipeService" /> </property> </action> </actions> </service> <service category="ba" name="processPipeService" description="Process Pipe Service"> <listeners> <jms-listener name="processPipeService_Aware" busidref="processPipeService_Aware" maxThreads="1"/> </listeners> <actions> <action name="print" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="printfull" value="true"/> </action> </actions> </service> </services> </jbossesb>
deployment.wml<jbossesb-deployment> <depends>jboss.messaging.destination:service=Queue,name=gw1</depends> <depends>jboss.messaging.destination:service=Queue,name=internalbus</depends> </jbossesb-deployment>
-
3. Re: JMS Selector support in 4.3GA
mathieu Jun 23, 2008 5:29 PM (in response to mathieu)I think I found the problem...
if I add a invmScope="NONE" in<service category="ba" name="processPipeService" description="Process Pipe Service" invmScope="NONE">
It does work. I guess that the InVm does not support selector...
Mathieu -
4. Re: JMS Selector support in 4.3GA
kconner Jun 24, 2008 5:09 AM (in response to mathieu)The selector is only used to qualify the incoming JMS messages and would not be relevant to the InVM courier. The InVM courier should only be using the service category/name to deliver any messages.
Could you please package up your test case and send it to my email address? -
5. Re: JMS Selector support in 4.3GA
kconner Jun 25, 2008 5:56 AM (in response to mathieu)Hiya Mathieu.
I tried running your app with InVM enabled and it worked as expected. Could you send me a log file from your test?
Thanks