-
15. Re: Divert to multiple destinations
mlange Oct 31, 2012 10:31 AM (in response to jmesnil)<core-queues>
<queue name="myQueue">
<address>myAddress</address>
</queue>
</core-queues>
OK I placed this in domain.xml just below the <jms-destinations>. Is this correct? Is it documented somewhere?
-
16. Re: Divert to multiple destinations
ataylor Oct 31, 2012 10:39 AM (in response to mlange)it certainly looks correct, I'm not sure where the AS7 docs live, but the schema for the messaging subsystem should be in the distro, jboss-as-messaging_1.0.xsd or what ever version you are using
-
17. Re: Divert to multiple destinations
mlange Nov 1, 2012 7:19 AM (in response to ataylor)Andy Taylor wrote:
can you post/attach your config and example code please and i will take a look
I have now defined these core queues mapped to one address ("abo"):
<core-queues>
<queue name="aboFezAdmPre">
<address>abo</address>
</queue>
<queue name="aboFezAdmLive">
<address>abo</address>
</queue>
</core-queues>
No additional jms queues are defined. In JConsole mbeans these core queues are listed:
Queue
|--Core
|--"abo"
|--aboFezAdmLive
|--aboFezAdmPre
These adresses are listed:
Adress
|--Core
|--"abo"
|--Bindings [aboFezAdmLive, aboFezAdmPre]
So this looks as if two core queues exist both mapped to the "abo" address. Sending a message to the "abo" address via core api. No message arrives neither in core queue "aboFezAdmLive" nor in "aboFezAdmPre". Why?
Consuming with JMS from one of the specific core queues offers the next problem:
javax.jms.JMSException: There is no queue with name aboFezAdmLive
at org.hornetq.jms.client.HornetQSession.createQueue(HornetQSession.java:407)
at org.hornetq.ra.HornetQRASession.createQueue(HornetQRASession.java:864)
I am completely stuck here.
-
18. Re: Divert to multiple destinations
ataylor Nov 1, 2012 7:31 AM (in response to mlange)do you have the rest of the stacktrace
-
19. Re: Divert to multiple destinations
mlange Nov 1, 2012 7:35 AM (in response to ataylor)Andy Taylor wrote:
do you have the rest of the stacktrace
The rest is only code from spring dmlc used for plain JMS message consuming:
javax.jms.JMSException: There is no queue with name aboFezAdmLive
at org.hornetq.jms.client.HornetQSession.createQueue(HornetQSession.java:407)
at org.hornetq.ra.HornetQRASession.createQueue(HornetQRASession.java:864)
at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveQueue(DynamicDestinationResolver.java:101)
at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:66)
at org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:221)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:307)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:952)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
-
20. Re: Divert to multiple destinations
ataylor Nov 1, 2012 7:40 AM (in response to mlange)this is because we prepend jms.queue when session.createQueue is called, its a jms naming convention we use, is there any way you can change how spring does this, i.e. using your own resolver
-
21. Re: Divert to multiple destinations
mlange Nov 1, 2012 7:55 AM (in response to ataylor)I could implement a custom resolver. But how should the destination name be resolved in the logic? At the moment we are starting the listener lazily so we have full control over the destination name used. What name should be used now in JMS world when we want to consume from one special core queue?
-
22. Re: Divert to multiple destinations
ataylor Nov 1, 2012 9:05 AM (in response to mlange)return new HornetQQueue("abo", "aboFezAdmPre", true, null); should do it
-
23. Re: Divert to multiple destinations
mlange Nov 1, 2012 9:45 AM (in response to ataylor)Andy Taylor wrote:
return new HornetQQueue("abo", "aboFezAdmPre", true, null); should do it
This seems to work- one step forward. Now the same happens when creating the consumer:
javax.jms.InvalidDestinationException: Queue aboFezAdmLive does not exist
at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:534)
at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:383)
at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:358)
at org.hornetq.ra.HornetQRASession.createConsumer(HornetQRASession.java:1081)
-
24. Re: Divert to multiple destinations
ataylor Nov 1, 2012 9:51 AM (in response to mlange)how are you creating the queue you sue in createConsumer?
-
25. Re: Divert to multiple destinations
mlange Nov 1, 2012 10:23 AM (in response to ataylor)Seems as if there is no binding found in the SimpleAddressManager and the binding query returns false for "exists":
public Bindings getMatchingBindings(final SimpleString address) throws Exception
{
Address add = new AddressImpl(address);
Bindings bindings = bindingsFactory.createBindings(address);
It tries to retrieve a binding for the address "aboFezAdmLive". But this address does not exist as we only have the "abo" address assigned to both core queue (names). So there is only a unidirectional mapping checked.
-
26. Re: Divert to multiple destinations
ataylor Nov 1, 2012 11:30 AM (in response to mlange)how do you create the queue that is used?
-
27. Re: Divert to multiple destinations
mlange Nov 1, 2012 11:59 AM (in response to ataylor)how do you create the queue that is used?
Andy, what do you mean with "creating the queue"? It is configured in domain.xml:
<core-queues>
<queue name="aboFezAdmLive">
<address>abo</address>
</queue>
</core-queues>
Thanks!
-
28. Re: Divert to multiple destinations
ataylor Nov 1, 2012 12:01 PM (in response to mlange)the queue object used in createConsumer
-
29. Re: Divert to multiple destinations
mlange Nov 1, 2012 12:04 PM (in response to ataylor)I did this as recommended before:
HornetQQueue queue = new HornetQQueue("aboFezAdmLive", "aboFezAdmLive", false, null);
So the name and address is identical.