You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Joan Bellver Faus <jb...@dsic.upv.es> on 2010/03/13 19:18:59 UTC

Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Hi, I have a problem when trying to connect to a broker in order to  
manage a session with the managament, well my code is as follows:


String connectionBroker =  
"amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
sess.addBroker(connectionBroker);


The error is this:

Exception in thread "Thread-3"  
org.apache.qpid.console.ConsoleException:  
org.apache.qpid.transport.SessionException: ch=0 id=0  
ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,  
commandCode=1, fieldIndex=0, description=not-allowed: Exchange names  
beginning with "amq." or "qpid." are reserved.  
(exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),  
errorInfo={})
	at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
	at org.apache.qpid.console.Broker.<init>(Broker.java:87)
	at org.apache.qpid.console.Session.addBroker(Session.java:70)

I am using the trunk version for both the broker c++ as for the java client.

  thank you very much.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Joan Bellver Faus <jb...@dsic.upv.es>.
Quoting Gordon Sim <gs...@redhat.com>:

> On 03/13/2010 06:18 PM, Joan Bellver Faus wrote:
>> Hi, I have a problem when trying to connect to a broker in order to
>> manage a session with the managament, well my code is as follows:
>>
>>
>> String connectionBroker =
>> "amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
>>
>> sess.addBroker(connectionBroker);
>>
>>
>> The error is this:
>>
>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>> org.apache.qpid.transport.SessionException: ch=0 id=0
>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange names
>> beginning with "amq." or "qpid." are reserved.
>> (exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),
>> errorInfo={})
>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>
>> I am using the trunk version for both the broker c++ as for the java
>> client.
>>
>> thank you very much.
>
> As a workaround you could perhaps turn off declaring of exchanges  
> using the system property -Dqpid.declare_exchanges=false.
>
> However I think this really requires a minor change along the lines  
> of the patch attached. (Some refactoring may be appropriate here to  
> avoid repeating the same check in two different places).
>


Hi, I tried to make me sugested changes in the last two mails and  
perfect work for me, also made another small change like you said up  
in class Broker.java.
This changes are:

BasicMessageProducer_0_10.java:

@@ -72,7 +72,7 @@
                  (name,
                   destination.getExchangeClass().toString(),
                   null, null,
-                 name.startsWith("amq.") ? Option.PASSIVE : Option.NONE);
+                 (name.startsWith("amq.")
			|| name.startsWith("qpid.")) ? Option.PASSIVE : Option.NONE);
          }
          else
          {

AMQSession\_0\_10.java
@@ -647,7 +647,7 @@
                  type,
                  alternateExchange,
                  args,
-                name.toString().startsWith("amq.") ? Option.PASSIVE
+                (name.toString().startsWith("amq.") ||
			name.toString().startsWith("qpid.")) ? Option.PASSIVE
                          : Option.NONE);
          // We need to sync so that we get notify of an error.
          if (!nowait)


Index: management/console/src/main/java/org/apache/qpid/console/Broker.java

-
"management://qpid.management//topic-%s?exclusive='True'&autodelete='True'";,
+
"management-topic://qpid.management//topic-%s?exclusive='True'&autodelete='True'";,
                              brokerId);
              reply = session.createQueue(replyName);
              MessageConsumer cons = session.createConsumer(reply);

-
String destName =  
String.format(``management://qpid.management//?routingkey='%s''',
+
String destName =  
String.format(``management-topic://qpid.management//?routingkey='%s''',

You can review the changes and tell me if the changes are correct? Or  
if there is a better solution please let me know.



Another problem is that when you test the trunk version of broker c++  
with a Java client when the execution finish and delete the queue that  
i created (with the method queueDelete(String name))in the part of  
broker gives me the following error: "Queue 'name of queue' has been  
deleted",as well if i close the session with session.close() gives me  
another error in the broker.
The session variable is a qpid.transport.Session type.

In this new version of broker,suposed that not close the session and  
delete the queues??


Thank you very much.


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: [qmf]: type change and backward compatibility (was Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.)

Posted by Ted Ross <tr...@redhat.com>.
On 03/22/2010 02:06 PM, Robert Godfrey wrote:
> On 22 March 2010 14:36, Ted Ross<tr...@redhat.com>  wrote:
>
>    
>> On 03/17/2010 01:39 PM, Gordon Sim wrote:
>>
>>      
>>> On 03/17/2010 04:43 PM, Robert Godfrey wrote:
>>>
>>>        
>>>> On 16 March 2010 18:50, Gordon Sim<gs...@redhat.com>   wrote:
>>>>
>>>>   On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
>>>>          
>>>>>   Exception in thread "Thread-3"
>>>>>            
>>>>>> org.apache.qpid.console.ConsoleException:
>>>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>>>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared
>>>>>> to be of type management-topic, requested management
>>>>>> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
>>>>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>>>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>>>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>>>>> at MMS_Example.MMS.execute(MMS.java:39)
>>>>>> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>
>>>>>>
>>>>>>              
>>>>> [snip]
>>>>>
>>>>>   any idea that happens?
>>>>>
>>>>>            
>>>>>>
>>>>>>              
>>>>> The type of the management exchange has been changed[1] and the java
>>>>> based
>>>>> QMF support needs to be updated.
>>>>>
>>>>>            
>>>>
>>>> Why has the type been changed?  Have I missed the discussion that must
>>>> have
>>>> occurred before such a change was made... this change would seem to have
>>>> implications both for clients (as demonstrated here) and for others
>>>> implementing management exchanges (for instance the Java Broker).
>>>>
>>>>          
>>>  From the commit it looks like a QMFv2 related change. I haven't been
>>> following all the design docs around that.
>>>
>>> However it does seem like this would break backwards compatibility for
>>> QMFv1. Must we change the type? If this is for QMFv2 and we want to keep
>>> QMFv1 support, it may be better to keep the old name and pick some new ones
>>> for v2?
>>>
>>>   This is my fault.  I assumed (because it's true in C++, Python, and Ruby)
>>>        
>> that the exchange type-name was not significant from the API perspective.
>>   Since the JMS API requires you to declare every exchange you use, the
>> change broke the Java console.
>>
>> The change I made was to create a pair of management exchange types (one
>> with direct routing and one with topic routing) for use as entry hooks for
>> the broker's QMFv2 agent.  Previously there was only one exchange (the topic
>> exchange).
>>
>> My preference would be to make the change on the Java console side but I
>> could also revert the type-name from "management-topic" back to
>> "management".
>>
>> I apologize for breaking the Java QMF console.
>>
>>
>>      
> The above doesn't make a great deal of sense to me to be honest. Why add a
> new type?  Why change the type of the existing management exchange (which is
> only used by the management exchange)?  And what is the point of having a
> direct type when the only difference between direct and topic is that topic
> allows for wildcards (or, put the other way, the only functionality that the
> direct exchange has that the topic doesn't is the ability to have "direct"
> mapping on routing keys containing the strings ".*." and ".#.")
>
> What exactly is the requirement here... and why does the type(-name) of the
> existing management exchange have to be changed?
>
> -- Rob
>    
[We should probably move this to dev]

The reasons for adding new exchange types are driven primarily by the 
way the C++ broker code is built.  There is no good reason from an AMQP 
standpoint to introduce new exchange types.  All we really want is a 
standard topic exchange that can route messages to an internal 
process/thread in the broker.  Ideally, the broker would be able to 
subscribe to one of its own queues and receive management messages.  
This would allow standard exchanges to be used for management.  In 
discussions with members of the C++ broker team, it was decided that 
this would be too difficult/disruptive to implement.

The alternate approach chosen was to extend the topic exchange to 
intercept management messages before they are routed.  Unfortunately 
this requires that the extension exchange have a distinct name, thus the 
introduction of the "management" exchange.

With regard to using the topic exchange for both "direct" and wildcarded 
keys, this would be a valid design alternative.  The use of a direct 
exchange for reply messages comes from what I perceive as the 
recommended pattern for direct replies and also the fact that direct 
exchanges have a more efficient routing algorithm than do topic exchanges.

The name of the existing management exchange did not have to be changed 
and I will happily change it back.

-Ted


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: [qmf]: type change and backward compatibility (was Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.)

Posted by Robert Godfrey <ro...@gmail.com>.
On 22 March 2010 14:36, Ted Ross <tr...@redhat.com> wrote:

> On 03/17/2010 01:39 PM, Gordon Sim wrote:
>
>> On 03/17/2010 04:43 PM, Robert Godfrey wrote:
>>
>>> On 16 March 2010 18:50, Gordon Sim<gs...@redhat.com>  wrote:
>>>
>>>  On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
>>>>
>>>>  Exception in thread "Thread-3"
>>>>> org.apache.qpid.console.ConsoleException:
>>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared
>>>>> to be of type management-topic, requested management
>>>>> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
>>>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>>>> at MMS_Example.MMS.execute(MMS.java:39)
>>>>> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>>
>>>> [snip]
>>>>
>>>>  any idea that happens?
>>>>
>>>>>
>>>>>
>>>> The type of the management exchange has been changed[1] and the java
>>>> based
>>>> QMF support needs to be updated.
>>>>
>>>
>>>
>>> Why has the type been changed?  Have I missed the discussion that must
>>> have
>>> occurred before such a change was made... this change would seem to have
>>> implications both for clients (as demonstrated here) and for others
>>> implementing management exchanges (for instance the Java Broker).
>>>
>>
>> From the commit it looks like a QMFv2 related change. I haven't been
>> following all the design docs around that.
>>
>> However it does seem like this would break backwards compatibility for
>> QMFv1. Must we change the type? If this is for QMFv2 and we want to keep
>> QMFv1 support, it may be better to keep the old name and pick some new ones
>> for v2?
>>
>>  This is my fault.  I assumed (because it's true in C++, Python, and Ruby)
> that the exchange type-name was not significant from the API perspective.
>  Since the JMS API requires you to declare every exchange you use, the
> change broke the Java console.
>
> The change I made was to create a pair of management exchange types (one
> with direct routing and one with topic routing) for use as entry hooks for
> the broker's QMFv2 agent.  Previously there was only one exchange (the topic
> exchange).
>
> My preference would be to make the change on the Java console side but I
> could also revert the type-name from "management-topic" back to
> "management".
>
> I apologize for breaking the Java QMF console.
>
>
The above doesn't make a great deal of sense to me to be honest. Why add a
new type?  Why change the type of the existing management exchange (which is
only used by the management exchange)?  And what is the point of having a
direct type when the only difference between direct and topic is that topic
allows for wildcards (or, put the other way, the only functionality that the
direct exchange has that the topic doesn't is the ability to have "direct"
mapping on routing keys containing the strings ".*." and ".#.")

What exactly is the requirement here... and why does the type(-name) of the
existing management exchange have to be changed?

-- Rob

-Ted
>
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Re: [qmf]: type change and backward compatibility (was Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.)

Posted by Ted Ross <tr...@redhat.com>.
On 03/17/2010 01:39 PM, Gordon Sim wrote:
> On 03/17/2010 04:43 PM, Robert Godfrey wrote:
>> On 16 March 2010 18:50, Gordon Sim<gs...@redhat.com>  wrote:
>>
>>> On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
>>>
>>>> Exception in thread "Thread-3" 
>>>> org.apache.qpid.console.ConsoleException:
>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange 
>>>> declared
>>>> to be of type management-topic, requested management
>>>> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
>>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>>> at MMS_Example.MMS.execute(MMS.java:39)
>>>> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
>>>> at java.lang.Thread.run(Thread.java:619)
>>>>
>>>
>>> [snip]
>>>
>>>   any idea that happens?
>>>>
>>>
>>> The type of the management exchange has been changed[1] and the java 
>>> based
>>> QMF support needs to be updated.
>>
>>
>> Why has the type been changed?  Have I missed the discussion that 
>> must have
>> occurred before such a change was made... this change would seem to have
>> implications both for clients (as demonstrated here) and for others
>> implementing management exchanges (for instance the Java Broker).
>
> From the commit it looks like a QMFv2 related change. I haven't been 
> following all the design docs around that.
>
> However it does seem like this would break backwards compatibility for 
> QMFv1. Must we change the type? If this is for QMFv2 and we want to 
> keep QMFv1 support, it may be better to keep the old name and pick 
> some new ones for v2?
>
This is my fault.  I assumed (because it's true in C++, Python, and 
Ruby) that the exchange type-name was not significant from the API 
perspective.  Since the JMS API requires you to declare every exchange 
you use, the change broke the Java console.

The change I made was to create a pair of management exchange types (one 
with direct routing and one with topic routing) for use as entry hooks 
for the broker's QMFv2 agent.  Previously there was only one exchange 
(the topic exchange).

My preference would be to make the change on the Java console side but I 
could also revert the type-name from "management-topic" back to 
"management".

I apologize for breaking the Java QMF console.

-Ted



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


[qmf]: type change and backward compatibility (was Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.)

Posted by Gordon Sim <gs...@redhat.com>.
On 03/17/2010 04:43 PM, Robert Godfrey wrote:
> On 16 March 2010 18:50, Gordon Sim<gs...@redhat.com>  wrote:
>
>> On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
>>
>>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared
>>> to be of type management-topic, requested management
>>> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>> at MMS_Example.MMS.execute(MMS.java:39)
>>> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
>>> at java.lang.Thread.run(Thread.java:619)
>>>
>>
>> [snip]
>>
>>   any idea that happens?
>>>
>>
>> The type of the management exchange has been changed[1] and the java based
>> QMF support needs to be updated.
>
>
> Why has the type been changed?  Have I missed the discussion that must have
> occurred before such a change was made... this change would seem to have
> implications both for clients (as demonstrated here) and for others
> implementing management exchanges (for instance the Java Broker).

 From the commit it looks like a QMFv2 related change. I haven't been 
following all the design docs around that.

However it does seem like this would break backwards compatibility for 
QMFv1. Must we change the type? If this is for QMFv2 and we want to keep 
QMFv1 support, it may be better to keep the old name and pick some new 
ones for v2?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Robert Godfrey <ro...@gmail.com>.
On 16 March 2010 18:50, Gordon Sim <gs...@redhat.com> wrote:

> On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
>
>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>> org.apache.qpid.transport.SessionException: ch=0 id=0
>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared
>> to be of type management-topic, requested management
>> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>> at MMS_Example.MMS.execute(MMS.java:39)
>> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
>> at java.lang.Thread.run(Thread.java:619)
>>
>
> [snip]
>
>  any idea that happens?
>>
>
> The type of the management exchange has been changed[1] and the java based
> QMF support needs to be updated.


Why has the type been changed?  Have I missed the discussion that must have
occurred before such a change was made... this change would seem to have
implications both for clients (as demonstrated here) and for others
implementing management exchanges (for instance the Java Broker).

-- Rob


> I am not an expert in this area but it looks to me like the string used for
> topicName in org.apache.qpid.console.Broker.tryToConnect() should be
> altered[2]. (Perhaps this should even be configurable in some way?)
>
> [1] http://svn.apache.org/viewvc?view=revision&revision=920189
>
> [2] i.e.
>
>> Index:
>> management/console/src/main/java/org/apache/qpid/console/Broker.java
>> ===================================================================
>> --- management/console/src/main/java/org/apache/qpid/console/Broker.java
>>      (revision 921956)
>> +++ management/console/src/main/java/org/apache/qpid/console/Broker.java
>>      (working copy)
>> @@ -403,7 +403,7 @@
>>                             brokerId);
>>             topicName = String
>>                     .format(
>> -
>>  "management://qpid.management//topic-%s?exclusive='True'&autodelete='True'",
>> +
>>  "management-topic://qpid.management//topic-%s?exclusive='True'&autodelete='True'",
>>                             brokerId);
>>             reply = session.createQueue(replyName);
>>             MessageConsumer cons = session.createConsumer(reply);
>>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Gordon Sim <gs...@redhat.com>.
On 03/15/2010 10:33 PM, Joan Bellver Faus wrote:
> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
> org.apache.qpid.transport.SessionException: ch=0 id=0
> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
> commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared
> to be of type management-topic, requested management
> (qpid/broker/SessionAdapter.cpp:121), errorInfo={})
> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
> at org.apache.qpid.console.Session.addBroker(Session.java:70)
> at MMS_Example.MMS.execute(MMS.java:39)
> at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
> at java.lang.Thread.run(Thread.java:619)

[snip]

> any idea that happens?

The type of the management exchange has been changed[1] and the java 
based QMF support needs to be updated. I am not an expert in this area 
but it looks to me like the string used for topicName in 
org.apache.qpid.console.Broker.tryToConnect() should be altered[2]. 
(Perhaps this should even be configurable in some way?)

[1] http://svn.apache.org/viewvc?view=revision&revision=920189

[2] i.e.
> Index: management/console/src/main/java/org/apache/qpid/console/Broker.java
> ===================================================================
> --- management/console/src/main/java/org/apache/qpid/console/Broker.java	(revision 921956)
> +++ management/console/src/main/java/org/apache/qpid/console/Broker.java	(working copy)
> @@ -403,7 +403,7 @@
>                              brokerId);
>              topicName = String
>                      .format(
> -                            "management://qpid.management//topic-%s?exclusive='True'&autodelete='True'",
> +                            "management-topic://qpid.management//topic-%s?exclusive='True'&autodelete='True'",
>                              brokerId);
>              reply = session.createQueue(replyName);
>              MessageConsumer cons = session.createConsumer(reply);

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Joan Bellver Faus <jb...@dsic.upv.es>.


Hi, thanks for your response, I tried to put the argument  
-Dqpid.declare_exchanges=false but I get this new error:


<Exception in thread "Thread-3"  
org.apache.qpid.console.ConsoleException: javax.jms.JMSException:  
Exception when sending message
	at org.apache.qpid.console.Broker.send(Broker.java:343)
	at org.apache.qpid.console.Broker.send(Broker.java:316)
	at org.apache.qpid.console.Broker.send(Broker.java:306)
	at org.apache.qpid.console.Broker.tryToConnect(Broker.java:426)
	at org.apache.qpid.console.Broker.<init>(Broker.java:87)
	at org.apache.qpid.console.Session.addBroker(Session.java:70)
	at MMS_Example.MMS.execute(MMS.java:39)
	at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.jms.JMSException: Exception when sending message
	at  
org.apache.qpid.client.BasicMessageProducer_0_10.sendMessage(BasicMessageProducer_0_10.java:217)
	at  
org.apache.qpid.client.BasicMessageProducer.sendImpl(BasicMessageProducer.java:490)
	at  
org.apache.qpid.client.BasicMessageProducer.sendImpl(BasicMessageProducer.java:445)
	at  
org.apache.qpid.client.BasicMessageProducer.send(BasicMessageProducer.java:325)
	at org.apache.qpid.console.Broker.send(Broker.java:340)
	... 8 more
Caused by: org.apache.qpid.transport.SessionException: ch=0 id=0  
ExecutionException(errorCode=NOT_ALLOWED, commandId=21, classCode=7,  
commandCode=1, fieldIndex=0, description=not-allowed: Exchange  
declared to be of type management-topic, requested management  
(qpid/broker/SessionAdapter.cpp:121), errorInfo={})
	at org.apache.qpid.transport.Session.invoke(Session.java:570)
	at org.apache.qpid.transport.Session.invoke(Session.java:518)
	at  
org.apache.qpid.transport.SessionInvoker.messageTransfer(SessionInvoker.java:96)
	at  
org.apache.qpid.client.BasicMessageProducer_0_10.sendMessage(BasicMessageProducer_0_10.java:203)
	... 12 more



If i change the code of the libraries according to the attached file I  
get these new errors,



Exception in thread "Thread-3"  
org.apache.qpid.console.ConsoleException:  
org.apache.qpid.transport.SessionException: ch=0 id=0  
ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,  
commandCode=1, fieldIndex=0, description=not-allowed: Exchange  
declared to be of type management-topic, requested management  
(qpid/broker/SessionAdapter.cpp:121), errorInfo={})
	at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
	at org.apache.qpid.console.Broker.<init>(Broker.java:87)
	at org.apache.qpid.console.Session.addBroker(Session.java:70)
	at MMS_Example.MMS.execute(MMS.java:39)
	at es.upv.dsic.gti_ia.core.BaseAgent.run(BaseAgent.java:290)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.qpid.transport.SessionException: ch=0 id=0  
ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,  
commandCode=1, fieldIndex=0, description=not-allowed: Exchange  
declared to be of type management-topic, requested management  
(qpid/broker/SessionAdapter.cpp:121), errorInfo={})
	at org.apache.qpid.transport.Session.invoke(Session.java:570)
	at org.apache.qpid.transport.Session.invoke(Session.java:518)
	at  
org.apache.qpid.transport.SessionInvoker.executionSync(SessionInvoker.java:84)
	at org.apache.qpid.transport.Session.sync(Session.java:724)
	at org.apache.qpid.transport.Session.sync(Session.java:712)
	at  
org.apache.qpid.client.AMQSession_0_10.sendExchangeDeclare(AMQSession_0_10.java:656)
	at  
org.apache.qpid.client.AMQSession_0_10.sendExchangeDeclare(AMQSession_0_10.java:638)
	at org.apache.qpid.client.AMQSession$8.execute(AMQSession.java:2394)
	at  
org.apache.qpid.client.failover.FailoverNoopSupport.execute(FailoverNoopSupport.java:67)
	at org.apache.qpid.client.AMQSession.declareExchange(AMQSession.java:2390)
	at org.apache.qpid.client.AMQSession.declareExchange(AMQSession.java:2344)
	at org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2573)
	at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:93)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1778)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1744)
	at  
org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:313)
	at  
org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
	at  
org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
	at org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1742)
	at org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:911)
	at org.apache.qpid.console.Broker.tryToConnect(Broker.java:414)
	... 5 more


any idea that happens?



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Rajith Attapattu <ra...@gmail.com>.
On Mon, Mar 15, 2010 at 10:01 AM, Gordon Sim <gs...@redhat.com> wrote:
> On 03/15/2010 01:51 PM, Rajith Attapattu wrote:
>>
>> -Dqpid.declare_exchanges=false. will not work here as that works only
>> at the JMS layer.
>
> I believe that is the layer at which org.apache.qpid.console.Broker
> operates.

My bad, yes it is !

>>
>> Rajith
>>
>> On Mon, Mar 15, 2010 at 6:37 AM, Gordon Sim<gs...@redhat.com>  wrote:
>>>
>>> On 03/13/2010 06:18 PM, Joan Bellver Faus wrote:
>>>>
>>>> Hi, I have a problem when trying to connect to a broker in order to
>>>> manage a session with the managament, well my code is as follows:
>>>>
>>>>
>>>> String connectionBroker =
>>>>
>>>>
>>>> "amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
>>>>
>>>> sess.addBroker(connectionBroker);
>>>>
>>>>
>>>> The error is this:
>>>>
>>>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange names
>>>> beginning with "amq." or "qpid." are reserved.
>>>> (exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),
>>>> errorInfo={})
>>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>>>
>>>> I am using the trunk version for both the broker c++ as for the java
>>>> client.
>>>>
>>>> thank you very much.
>>>
>>> As a workaround you could perhaps turn off declaring of exchanges using
>>> the
>>> system property -Dqpid.declare_exchanges=false.
>>>
>>> However I think this really requires a minor change along the lines of
>>> the
>>> patch attached. (Some refactoring may be appropriate here to avoid
>>> repeating
>>> the same check in two different places).
>>>
>>>
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Gordon Sim <gs...@redhat.com>.
On 03/15/2010 01:51 PM, Rajith Attapattu wrote:
> -Dqpid.declare_exchanges=false. will not work here as that works only
> at the JMS layer.

I believe that is the layer at which org.apache.qpid.console.Broker 
operates.

>
> Rajith
>
> On Mon, Mar 15, 2010 at 6:37 AM, Gordon Sim<gs...@redhat.com>  wrote:
>> On 03/13/2010 06:18 PM, Joan Bellver Faus wrote:
>>>
>>> Hi, I have a problem when trying to connect to a broker in order to
>>> manage a session with the managament, well my code is as follows:
>>>
>>>
>>> String connectionBroker =
>>>
>>> "amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
>>>
>>> sess.addBroker(connectionBroker);
>>>
>>>
>>> The error is this:
>>>
>>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange names
>>> beginning with "amq." or "qpid." are reserved.
>>> (exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),
>>> errorInfo={})
>>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>>
>>> I am using the trunk version for both the broker c++ as for the java
>>> client.
>>>
>>> thank you very much.
>>
>> As a workaround you could perhaps turn off declaring of exchanges using the
>> system property -Dqpid.declare_exchanges=false.
>>
>> However I think this really requires a minor change along the lines of the
>> patch attached. (Some refactoring may be appropriate here to avoid repeating
>> the same check in two different places).
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Rajith Attapattu <ra...@gmail.com>.
-Dqpid.declare_exchanges=false. will not work here as that works only
at the JMS layer.

Rajith

On Mon, Mar 15, 2010 at 6:37 AM, Gordon Sim <gs...@redhat.com> wrote:
> On 03/13/2010 06:18 PM, Joan Bellver Faus wrote:
>>
>> Hi, I have a problem when trying to connect to a broker in order to
>> manage a session with the managament, well my code is as follows:
>>
>>
>> String connectionBroker =
>>
>> "amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
>>
>> sess.addBroker(connectionBroker);
>>
>>
>> The error is this:
>>
>> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
>> org.apache.qpid.transport.SessionException: ch=0 id=0
>> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
>> commandCode=1, fieldIndex=0, description=not-allowed: Exchange names
>> beginning with "amq." or "qpid." are reserved.
>> (exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),
>> errorInfo={})
>> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
>> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
>> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>>
>> I am using the trunk version for both the broker c++ as for the java
>> client.
>>
>> thank you very much.
>
> As a workaround you could perhaps turn off declaring of exchanges using the
> system property -Dqpid.declare_exchanges=false.
>
> However I think this really requires a minor change along the lines of the
> patch attached. (Some refactoring may be appropriate here to avoid repeating
> the same check in two different places).
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Problem with Session.addBroker(), Exchange names beginning with "amq." or "qpid." are reserved.

Posted by Gordon Sim <gs...@redhat.com>.
On 03/13/2010 06:18 PM, Joan Bellver Faus wrote:
> Hi, I have a problem when trying to connect to a broker in order to
> manage a session with the managament, well my code is as follows:
>
>
> String connectionBroker =
> "amqp://guest:guest@/test?brokerlist='tcp://localhost:5671?ssl='true',sasl_mechs='EXTERNAL''";
>
> sess.addBroker(connectionBroker);
>
>
> The error is this:
>
> Exception in thread "Thread-3" org.apache.qpid.console.ConsoleException:
> org.apache.qpid.transport.SessionException: ch=0 id=0
> ExecutionException(errorCode=NOT_ALLOWED, commandId=10, classCode=7,
> commandCode=1, fieldIndex=0, description=not-allowed: Exchange names
> beginning with "amq." or "qpid." are reserved.
> (exchange="qpid.management") (qpid/broker/SessionAdapter.cpp:89),
> errorInfo={})
> at org.apache.qpid.console.Broker.tryToConnect(Broker.java:421)
> at org.apache.qpid.console.Broker.<init>(Broker.java:87)
> at org.apache.qpid.console.Session.addBroker(Session.java:70)
>
> I am using the trunk version for both the broker c++ as for the java
> client.
>
> thank you very much.

As a workaround you could perhaps turn off declaring of exchanges using 
the system property -Dqpid.declare_exchanges=false.

However I think this really requires a minor change along the lines of 
the patch attached. (Some refactoring may be appropriate here to avoid 
repeating the same check in two different places).