Interesting, the prefix "ID:" denotes a temp queue, it is generated
from the default connection id scheme. The consumer is doing a check
based on the connection id, it throws the exception because foo does
not match the auto generated connection id.

>From the code, it looks like there is a way around this,
org.apache.activemq.ActiveMQConnectionFactory#setClientIDPrefix

The default prefix is "ID:<hostName>, if you set it to
ID:ReplyDest.<hostname>, all of your connections and temp destinations
will match a wild card "ID:ReplyDest.>" for inclusion in a statically
included destination, but will also match their connection ids, so
creating consumers will work ok.

> on regular queues
When you use "temp.foo" you are creating a regular queue that is not
tied to a connection.

Correct, if the reply queue is shared, you will need to use a selector
based on correlation id.

Have a read of 
http://trenaman.blogspot.com/2009/01/message-selectors-and-activemq.html
for insights into the use of selectors.


On 22 March 2011 20:55, anuhbava <anubh...@aol.com> wrote:
> Gary,
>
> Many thanks for taking time to respond in detail on this issue.
>
> However when I attempted taking your approach # 1 (creating a named queue
> with name="ID:foo") I am getting this exception from createConsumer()
> method:
>
>     [java] javax.jms.InvalidDestinationException: Cannot use a Temporary
> destination from another Connection
>     [java]     at
> org.apache.activemq.ActiveMQMessageConsumer.(ActiveMQMessageConsumer.java:189)
>     [java]     at
> org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1116)
>     [java]     at
> org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1060)
>     [java]     at
> org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:973)
>     [java]     at
> org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:946)
>
> When I name it something else like "temp.foo" it doesn't throw this
> exception however client doesn't get the responses back because that is not
> included in staticallyIncludedDestinations tag. so most likely it doesn't
> allow a queue name to start with "ID:".
>
> Regarding using regular queues for reply processing: Wouldn't we need to use
> selectors in that case to make sure response reaches back to the very same
> client instance of origin?
>
> Unfortunately the reason why I am chasing this issue is that ours is a large
> network with many dynamic producers/consumers causing creation of thousands
> of advisory topics on each broker instance.
>
> cheers,
> Anubhava
>
>
> Gary Tully wrote:
>>
>> correct, networking the dynamically created and named temp queues
>> require advisories.
>>
>> First note that advisories are typically fine, it is only in large
>> networks with many dynamic consumers that the advisory overhead is
>> significant.
>>
>> There are two possible workarounds for request reply when advisories
>> are disabled.
>> The first is to use named temp queues via
>> org.apache.activemq.ActiveMQSession#createQueue where names that start
>> with &quot;ID:&quot; are temporary.
>> The second is to use regular queues for reply processing. Using
>> regular queues gives the option to use persistent replies if you want
>> to deterministically process replies.
>> In both cases, the reply destination names will need to be included in
>> staticallyIncludedDestinations.
>>
>> It would be nice if it was possible to create a wildcard statically
>> included destination for all temp queues, but the current naming
>> convention will not facilitate that.
>> With s suitable prefix (say &quot;REPLY.&quot;) for you named temp queue
>> or
>> reply queue, a wildcard staticallyIncludedDestinations should work
>> fine.
>>
>> On 22 March 2011 02:26, anuhbava &lt;anubh...@aol.com&gt; wrote:
>> &gt; Gary,
>> &gt;
>> &gt; I ran into issues using advisorySupport=&quot;false&quot; and
>> &gt; staticallyIncludedDestinations.
>> &gt;
>> &gt; We use JMS for mostly request-response like described here:
>> &gt;
>> http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html
>> &gt;
>> &gt; We are using temporary queue on Producer side to be able to receive
>> response
>> &gt; from Consumers and since staticallyIncludedDestinations cannot
>> include these
>> &gt; temporary queue names in it therefore all the Producers are unable to
>> &gt; receive responses back from clients when advisorySupport is disabled.
>> &gt;
>> &gt; I am coming to conclusion that for our scenario advisorySupport
>> cannot be
>> &gt; turned off unless there is some other config trick I'm not aware of.
>> &gt;
>> &gt; Thanks,
>> &gt; Anubhava
>> &gt;
>> &gt;
>> &gt; On Mon, Mar 21, 2011 at 2:35 PM, Gary Tully [via ActiveMQ] &lt;
>> &gt; ml-node+3394397-1352398844-221...@n4.nabble.com&gt; wrote:
>> &gt;
>> &gt;&gt; thanks for closing the loop.
>> &gt;&gt;
>> &gt;&gt; On 21 March 2011 18:11, anuhbava &lt;[hidden
>> email]&lt;http://user/SendEmail.jtp?type=node&amp;node=3394397&amp;i=0&amp;by-user=t&gt;&gt;
>> &gt;&gt; wrote:
>> &gt;&gt;
>> &gt;&gt; &gt; Thank you very much Gary.
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; Including this config:
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; &lt;staticallyIncludedDestinations&gt;
>> &gt;&gt; &gt;         &lt;queue physicalName=&quot;TEST.FOO&quot;/&gt;
>> &gt;&gt; &gt;         &lt;queue physicalName=&quot;TEST.BAR&quot;/&gt;
>> &gt;&gt; &gt; &lt;/staticallyIncludedDestinations&gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; inside networkConnector tag did the trick.
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; cheers,
>> &gt;&gt; &gt; Anubhava
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; On Mon, Mar 21, 2011 at 7:54 AM, Gary Tully [via ActiveMQ]
>> &lt;
>> &gt;&gt; &gt; [hidden
>> email]&lt;http://user/SendEmail.jtp?type=node&amp;node=3394397&amp;i=1&amp;by-user=t&gt;&gt;
>> &gt;&gt; wrote:
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;&gt; without advisories, you need to explicitly specify the
>> list of
>> &gt;&gt; &gt;&gt; statically included/excluded destinations for each
>> network connector.
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt; On 18 March 2011 22:42, anuhbava &lt;[hidden email]&lt;
>> &gt;&gt;
>> http://user/SendEmail.jtp?type=node&amp;node=3393367&amp;i=0&amp;by-user=t&gt;&gt;
>> &gt;&gt;
>> &gt;&gt; &gt;&gt; wrote:
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt; &gt; If you see my networkConnector tag in original post
>> you will notice
>> &gt;&gt; that
>> &gt;&gt; &gt;&gt; I
>> &gt;&gt; &gt;&gt; &gt; don't have dynamic network brokers. Both of my
>> brokers have
>> &gt;&gt; &gt;&gt; &gt; uri=&quot;static:(tcp://localhost:61616)&quot; and
>> &gt;&gt; &gt;&gt; &gt; uri=&quot;static:(tcp://localhost:61617)&quot;
>> &gt;&gt; &gt;&gt; &gt;
>> &gt;&gt; &gt;&gt; &gt; Thanks.
>> &gt;&gt; &gt;&gt; &gt;
>> &gt;&gt; &gt;&gt; &gt; --
>> &gt;&gt; &gt;&gt; &gt; View this message in context:
>> &gt;&gt; &gt;&gt;
>> &gt;&gt;
>> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3388635.html&lt;http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3388635.html?by-user=t&gt;&lt;http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3388635.html%3Chttp://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3388635.html?by-user=t%3E&amp;by-user=t&gt;
>> &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt; &gt; Sent from the ActiveMQ - User mailing list archive
>> at Nabble.com.
>> &gt;&gt; &gt;&gt; &gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt; --
>> &gt;&gt; &gt;&gt; http://blog.garytully.com
>> &gt;&gt; &gt;&gt; http://fusesource.com
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt; ------------------------------
>> &gt;&gt; &gt;&gt;  If you reply to this email, your message will be added
>> to the
>> &gt;&gt; discussion
>> &gt;&gt; &gt;&gt; below:
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt;
>> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3393367.html&lt;http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3393367.html?by-user=t&gt;
>> &gt;&gt; &gt;&gt;  To unsubscribe from network of broker stop forwarding
>> messages without
>> &gt;&gt; &gt;&gt; advisorySupport enabled, click here&lt;
>> &gt;&gt;
>> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=3386261&amp;code=YW51YmhhdmFAYW9sLmNvbXwzMzg2MjYxfDE5NDQ4NzEwMjE=&gt;&lt;http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=3386261&amp;code=YW51YmhhdmFAYW9sLmNvbXwzMzg2MjYxfDE5NDQ4NzEwMjE=%3E&amp;by-user=t&gt;.
>> &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;&gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; --
>> &gt;&gt; &gt; View this message in context:
>> &gt;&gt;
>> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3394328.html&lt;http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3394328.html?by-user=t&gt;
>> &gt;&gt;
>> &gt;&gt; &gt; Sent from the ActiveMQ - User mailing list archive at
>> Nabble.com.
>> &gt;&gt;
>> &gt;&gt;
>> &gt;&gt;
>> &gt;&gt; --
>> &gt;&gt; http://blog.garytully.com
>> &gt;&gt; http://fusesource.com
>> &gt;&gt;
>> &gt;&gt;
>> &gt;&gt; ------------------------------
>> &gt;&gt;  If you reply to this email, your message will be added to the
>> discussion
>> &gt;&gt; below:
>> &gt;&gt;
>> &gt;&gt;
>> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3394397.html
>> &gt;&gt;  To unsubscribe from network of broker stop forwarding messages
>> without
>> &gt;&gt; advisorySupport enabled, click
>> here&lt;http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=3386261&amp;code=YW51YmhhdmFAYW9sLmNvbXwzMzg2MjYxfDE5NDQ4NzEwMjE=&gt;.
>> &gt;&gt;
>> &gt;&gt;
>> &gt;
>> &gt;
>> &gt; --
>> &gt; View this message in context:
>> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3395331.html
>> &gt; Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> http://blog.garytully.com
>> http://fusesource.com
>>
>
>
> --
> View this message in context: 
> http://activemq.2283324.n4.nabble.com/network-of-broker-stop-forwarding-messages-without-advisorySupport-enabled-tp3386261p3397734.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Reply via email to