-
1. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
tcunning Nov 10, 2011 1:05 PM (in response to matzeg)1 of 1 people found this helpfulHi Matthias,
You can definitely redirect a JMS message with the ESB. I'd take a look at the jms_router quickstart for an example of that, and I'd also take a look at the ejbprocessor quickstart to see if having the ESB invoke EJB methods helps you at all.
-
2. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
matzeg Nov 13, 2011 7:04 AM (in response to tcunning)Hi Tom,
thanks for your reply! The quickstart is pure gold for me. I only got one problem left..
I changed the example a bit for a proof of concept. The problem is, my MDB does not recieve the redirected message.
Following is my MDB, very simple because the other versions I've made do not work as expected.
So if the message is sent to the queue the mdb should print something, but there is absolutely no reaction. Did I do something wrong?
Thanks in advance!
Matthias
package de.private.poc.beans.mdb; import javax.annotation.Resource; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.ejb.MessageDrivenContext; import javax.jms.Message; import javax.jms.MessageListener; /** * * @author matthias */ @MessageDriven(mappedName = "GatewayResponse", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/quickstart_jms_routeTo") }) public class GatewayResponse implements MessageListener { public GatewayResponse() { } @Override public void onMessage(Message message) { System.out.println("Test"); } }
PS:
I've deployed the MDB with and without ear, no result though..
-
3. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
tcunning Nov 13, 2011 8:49 PM (in response to matzeg)Have you checked the queue it should be reading to make sure the message is getting there?
-
4. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
matzeg Nov 14, 2011 7:50 AM (in response to tcunning)I've solved the problem. The MDB needed to authenticate to the queue from the quickstart.
I just added the annotations:
@ActivationConfigProperty(propertyName = "user", propertyValue = "esbuser"), @ActivationConfigProperty(propertyName = "password", propertyValue = "esbpassword"), -
5. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
matzeg Nov 18, 2011 6:37 AM (in response to matzeg)So I have a simple problem of understanding this quickstart.
If I send a message to the gateway, how can I specify the destination where the message gets redirected to? In this example the message ends at /queue/jms_quickstart_replyTo but I do not find the queue name in the configuration files. Also, If I add another gateway to this esb, how can I specify that only one special configured action is done and not for example the esb console output?
For understanding:
At the moment I have a EJB that sends a message to the ESB gateway queue and then gets redirected to the /queue/jms_quickstart_replyTo where my MDB is listening. For now, I just answer with a message to the first EJB but in the future this answer should also go over the esb and then end at the first EJB. Also There will be more services communicating over the esb with other gateways and other actions to do..Thanks in advance!
-
6. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
tcunning Nov 20, 2011 12:10 AM (in response to matzeg)You should be able to configure the JMSRouter action to send the message to the queue you want to. You're using the jms_router quickstart? Are you seeing the following output?
runtest:
[echo] Runs Test JMS Sender
[java] Connection Started
[java] Sent message with CorrelationID : QuickstartId[3]
[java]
[java] Received from JBossQueue[quickstart_jms_router_routeTo]:
[java] [JMSMessageID : ID:JBM-3d606fac-18ca-4156-be52-48b30cc7b7ee]
[java] [JMSCorrelelationID : QuickstartId[3]]
[java] [JMSReplyto : null]
[java] [MessageType : TextMessage]
[java] [Text : JMS Router Message dummy Content]
[java] [Property: MyProperty : My property value]
-
7. Re: JBoss ESB 4.10, JBoss 6: Simple Request/Response between EJBs
matzeg Nov 21, 2011 5:25 AM (in response to tcunning)Hi Tom,
yes I see the following output.
I've found the line for the queue to route to, but is it possible to use instead the JMSReplyTo-flag for the esb so that it sends the message to the queue of JMSReplyto? So dynamical routing with the JMSReplyTo-Attribute?
Thanks in advance!
[Edit: ]
I've already found the cbs-example, but there have to be an easier way by just using the JMSReplyTo-Attribute?