Issue to publish or subscribe to/from topic with AMQP 1.0

523 views
Skip to first unread message

bendaoud mohamed

unread,
Aug 20, 2015, 8:15:51 AM8/20/15
to rabbitmq-users
I am studying AMQP protocol, i installed latest RabbitMQ version, i used default configuration. When i published message to topic with SwiftMQ/Proton JAVA client. the rabbitMQ broker disconnected me automatically. I checked log fil. Anyone has the same issue ???

log file : 
=INFO REPORT==== 20-Aug-2015::12:11:52 ===
accepting AMQP connection <0.558.22> (192.168.10.1:55273 -> 192.168.10.1:5673)

=WARNING REPORT==== 20-Aug-2015::12:11:54 ===
Closing session for connection <0.558.22>:
{'v1_0.error',{symbol,<<"amqp:invalid-field">>},
              {utf8,<<"Attach rejected: {unknown_destination,\"topic://if-topic014\"}">>},
              undefined}
 
And i tested the same client with ActiveMQ and IBM WebsphereMQ. and it was ok.

Michael Klishin

unread,
Aug 20, 2015, 8:18:39 AM8/20/15
to rabbitm...@googlegroups.com, bendaoud mohamed
On 20 August 2015 at 15:15:53, bendaoud mohamed (bendaou...@gmail.com) wrote:
> I am studying AMQP protocol, i installed latest RabbitMQ version,
> i used default configuration. When i published message to topic
> with SwiftMQ/Proton JAVA client. the rabbitMQ broker disconnected
> me automatically. I checked log fil. Anyone has the same issue
> ???
>
> log file :
> =INFO REPORT==== 20-Aug-2015::12:11:52 ===
> accepting AMQP connection <0.558.22> (192.168.10.1:55273
> -> 192.168.10.1:5673)
>
> =WARNING REPORT==== 20-Aug-2015::12:11:54 ===
> Closing session for connection <0.558.22>:
> {'v1_0.error',{symbol,<<"amqp:invalid-field">>},
> {utf8,<<"Attach rejected: {unknown_destination,\"topic://if-topic014\"}">>},
> undefined}

You are trying to use AMQP 1.0. It needs a plugin (ships with rabbitmq, see rabbitmq-plugins list).

RabbitMQ's primary protocol is AMQP 0-9-1 and despite the name, it is an entirely
different protocol from 1.0. The 0-9-1 ecosystem (client libraries, support in tools such as Wireshark,
documentation available) is well ahead 1.0 at the moment, so you may want to consider 
that protocol.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Michael Klishin

unread,
Aug 20, 2015, 8:26:42 AM8/20/15
to bendaoud mohamed, rabbitm...@googlegroups.com
+rabbitmq-users

On 20 August 2015 at 15:22:10, bendaoud mohamed (bendaou...@gmail.com) wrote:
> Sorry i forgot to say, i already installed this plugin. Moreover,
> i can put and get message from/to queue with SwiftMQ with this
> protocol. But i can't for pub/sub.

OK, this may be a limitation in the plugin: it hasn't been updated much in the last
couple of years.

Can you post a code snippet we can use to look into it later? 

Gotthard, Petr

unread,
Aug 20, 2015, 8:34:56 AM8/20/15
to rabbitm...@googlegroups.com, bendaoud mohamed
> On 20 August 2015 at 15:22:10, bendaoud mohamed
> (bendaou...@gmail.com) wrote:
> > Sorry i forgot to say, i already installed this plugin. Moreover, i
> > can put and get message from/to queue with SwiftMQ with this protocol.
> > But i can't for pub/sub.
>
> OK, this may be a limitation in the plugin: it hasn't been updated much in the
> last couple of years.
>

I think the problem is the "topic" prefix in here:

> {'v1_0.error',{symbol,<<"amqp:invalid-field">>},
> {utf8,<<"Attach rejected:
> {unknown_destination,\"topic://if-topic014\"}">>},
> undefined}

The AMQP 1.0 does not know anything about "topics", so it does not guarantee interoperability when someone is "publishing to a topic".

The plugin documentation https://github.com/rabbitmq/rabbitmq-amqp1.0 lists possible targets you may use when sending a message over AMQP 1.0. It seems to me that you try to send the message to a queue called "topic://if-topic014", which is not a valid name for a queue.

Could you get rid of the "topic://" prefix?


Petr

Gotthard, Petr

unread,
Aug 20, 2015, 9:04:51 AM8/20/15
to bendaoud mohamed, rabbitm...@googlegroups.com
> I removed the "topic://" prefix and the message is put within queue and not
> within topic.

Sending a message to "ABC" means you publish the message to default exchange with routing key ABC, i.e. the message arrives to the queue "ABC". This is an expected behavior.

Please have a look at
https://github.com/rabbitmq/rabbitmq-amqp1.0#routing-and-addressing

The page discusses other options. For example, if you send the message to "/topic/ABC" it will get published to amq.topic Exchange with routing key ABC, i.e. the message arrives (depending on the binding/routing keys) to some queue(s) bound to the amq.topic Exchange.

> > I think the problem is the "topic" prefix in here:
> >
> > > {'v1_0.error',{symbol,<<"amqp:invalid-field">>},
> > > {utf8,<<"Attach rejected:
> > > {unknown_destination,\"topic://if-topic014\"}">>},
> > > undefined}
> >
> > The AMQP 1.0 does not know anything about "topics", so it does not
> > guarantee interoperability when someone is "publishing to a topic".
> >
> > The plugin documentation https://github.com/rabbitmq/rabbitmq-amqp1.0
> > lists possible targets you may use when sending a message over AMQP 1.0. It
> > seems to me that you try to send the message to a queue called "topic://if-
> > topic014", which is not a valid name for a queue.
> >
> > Could you get rid of the "topic://" prefix?

Regards,
Petr

Gotthard, Petr

unread,
Aug 20, 2015, 9:25:49 AM8/20/15
to rabbitm...@googlegroups.com, bendaoud mohamed
Still there may be one deficiency in RabbitMQ. I filled an issue for that
https://github.com/rabbitmq/rabbitmq-amqp1.0/issues/18
> --
> You received this message because you are subscribed to the Google Groups
> "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages