I am testing RabbitMQ for suitability in a pub/sub application over multi
data centre network.

Existing clients are using stomp so we need to stay on stomp if at all
possible. I am trying to set up federation with stomp. Federation seems
to work fine, in that the log tells me it has federated links to the 2
upstream exchanges that are set up in the .config file. And using amqp I
can send to the upstream exchange and have a consumer pick it up off the
downstream exchange.

When using stomp with a perl client set, I connect to the upstream exchange
with destination /exchange/<exchange name> and get an auto-delete queue. I
can configure a consumer client with the same destination and it pulls off
the messages fine. The problem is that the consumer must be connected or
any messages sent by the producer are lost.

Is there a way to have a non-auto delete queue on the upstream exchange
that I can connect to via stomp?

Thanks
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120215/5ad21df3/attachment.htm>

Search Discussions

  • Steve Powell at Feb 23, 2012 at 12:50 pm
    Patrick,
    Sorry to take so long to get back to you.

    As you point out, SUBSCRIBE to an exchange destination will create an exclusive,
    auto-delete queue for that STOMP session and client, and topic exchanges discard
    messages when there is no queue to put the messages in.

    What is happening is that the queue NOT created on a SEND, so when there is no
    SUBSCRIBEr, there is no queue and so the topic exchange discards the messages.

    If you want to retain topic messages after the subscriber disconnects,
    then look at the Durable Topic Subscription extension for RabbitMQ STOMP
    (see http://www.rabbitmq.com/stomp.html#d.dts).

    Hope this helps,

    Steve Powell
    steve at rabbitmq.com
    [wrk: +44-2380-111-528] [mob: +44-7815-838-558]
    On 15 Feb 2012, at 15:29, patrickf wrote:

    I am testing RabbitMQ for suitability in a pub/sub application over multi data centre network.

    Existing clients are using stomp so we need to stay on stomp if at all possible. I am trying to set up federation with stomp. Federation seems to work fine, in that the log tells me it has federated links to the 2 upstream exchanges that are set up in the .config file. And using amqp I can send to the upstream exchange and have a consumer pick it up off the downstream exchange.

    When using stomp with a perl client set, I connect to the upstream exchange with destination /exchange/<exchange name> and get an auto-delete queue. I can configure a consumer client with the same destination and it pulls off the messages fine. The problem is that the consumer must be connected or any messages sent by the producer are lost.

    Is there a way to have a non-auto delete queue on the upstream exchange that I can connect to via stomp?

    Thanks
    Patrick
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Joshua__lim at Jan 14, 2014 at 5:08 am
    Hi Steve, I've been trying to get Durable Exchange to work without success,
    both topic and direct exchange. Here's my findings:


    I read somewhere that says to create durable subscription for exchange, I'd
    need to set the client-id header on the CONNECT and the id header to a
    unique string and set persistent: true. This doesn't appear to work at this
    moment as subscribed-clients will lose messages sent to the exchange if they
    are not connected.


    What I've observed from the web management console is that the messages are
    being sent to and buffered on the "amq.gen-random-characters-here" queue
    created when the client was last connected. Note: This
    "amq.gen-random-characters-here" queue is durable.


    When the consumer reconnects using the same client-id header and
    re-subscribes using the same id, a new queue is generated and this queue has
    no messages.


    Here's what I did:


    Consumer:


    ncat localhost 61613
    CONNECT
    login:joshua
    passcode:joshua
    client-id:connect-03


    ^@
    CONNECTED
    session:session-a5K-Wxdgg0TzUn9Ym6bKgg
    heart-beat:0,0
    server:RabbitMQ/3.2.1
    version:1.0


      SUBSCRIBE
    destination:/exchange/topic-x/high.*
    ack:client-individual
    id:subscribe-03
    persistent:true
    receipt:001


    ^@
    RECEIPT
    receipt-id:001


      MESSAGE
    subscription:subscribe-03
    destination:/exchange/topic-x/high.alarm
    message-id:T_subscribe-03@@session-a5K-Wxdgg0TzUn9Ym6bKgg@@1
    delivery-mode:2
    receipt:002
    app-id:guest
    persistent:true
    content-length:6


    test3
      ^C


    Producer:


    ncat localhost 61613
    CONNECT
    login:guest
    passcode:guest
    client-id:guest


    ^@
    CONNECTED
    session:session-Q1Di3bc_DBXPHPT90h55NQ
    heart-beat:0,0
    server:RabbitMQ/3.2.1
    version:1.0


      SEND
    destination:/exchange/topic-x2/high.alarm
    receipt:001
    persistent:true
    delivery-mode:2
    app-id:guest


    test1
    ^@
    RECEIPT
    receipt-id:001




    Finally, I've tried the Durable Topic Subscription - /topic/<name> using a
    unique id in the subscribe header + persistent: true. It appears that only
    the first or first two message that is queued when the subscriber is offline
    is delivered when the subscriber is back online. So even if I sent 10-20
    messages, only 1 or 2 messages is successfully delivered.


    Rgds,
    Joshua






    --
    View this message in context: http://rabbitmq.1065348.n5.nabble.com/Federation-and-Stomp-tp20052p32536.html
    Sent from the RabbitMQ mailing list archive at Nabble.com.
  • Emile Joubert at Jan 14, 2014 at 12:41 pm
    Hi Joshua,


    On 14/01/14 05:08, joshua__lim wrote:

    I read somewhere that says to create durable subscription for exchange, I'd
    need to set the client-id header on the CONNECT and the id header to a
    unique string and set persistent: true. This doesn't appear to work



    The "Durable Topic Subscription" section explains how to set up durable
    topic subscriptions. This only works for topic subscriptions.
    http://www.rabbitmq.com/stomp.html#d.dts

    SUBSCRIBE
    destination:/exchange/topic-x/high.*



    The destination must start with "/topic"








    -Emile
  • Steve Powell at Jan 14, 2014 at 5:34 pm
    Joshua,


    Emile has replied already, but I wanted to point out that RabbitMQ STOMP adapter
    doesn't support "client-id"s on CONNECT (they are ignored), instead just the
    destination (/topic/<name>) and the id are used to identify the subscription.


    You may have read about client-ids in ActiveMQ documentation.


    The SUBSCRIBE you showed us would create an exclusive auto-delete queue (not a
    shared one) and this would therefore get deleted when the subscriber disconnected.


    Try this:


    SUBSCRIBE
    destination:/topic/high.*
    ack:client-individual
    id:subscribe-03
    persistent:true


    ^@


    and then use exactly the same subscription after reconnect to receive messages.


    You should UNSUBSCRIBE (see the doc) when this is no longer needed, or the
    queue may stay around for a long time.


    At present you cannot create a durable subscription to an /exchange/<x-name>/<r-key>
    destination.


    I hope this helps you: please let us know how you get on.


    Steve Powell [M: +44-7815-838-558; H:+44-1962-775-598; W:+44-2380-111-528]
         What I tell you three times is true.
    Lewis Carroll; Hunting of the Snark: Fit the First


    On 14 Jan 2014, at 05:08, joshua__lim wrote:

    I read somewhere that says to create durable subscription for exchange, I'd
    need to set the client-id header on the CONNECT and the id header to a
    unique string and set persistent: true. This doesn't appear to work at this
    moment as subscribed-clients will lose messages sent to the exchange if they
    are not connected.
  • Joshua__lim at Jan 16, 2014 at 3:18 am
    Hi Steve, thanks for letting me know. Yes, I confirm that the following works:
    SUBSCRIBE
    destination:/topic/high.*
    ack:client-individual
    id:subscribe-03
    persistent:true
    It worked via ncat, after further testing, I found a js bug in my consumer app that hang Chrome after a message was received.
    Rgds,Joshua


    Date: Tue, 14 Jan 2014 09:35:26 -0800
    From: ml-node+s1065348n32562h36 at n5.nabble.com
    To: joshua__lim at hotmail.com
    Subject: Re: Federation and Stomp






      Joshua,




    Emile has replied already, but I wanted to point out that RabbitMQ STOMP adapter


    doesn't support "client-id"s on CONNECT (they are ignored), instead just the


    destination (/topic/<name>) and the id are used to identify the subscription.




    You may have read about client-ids in ActiveMQ documentation.




    The SUBSCRIBE you showed us would create an exclusive auto-delete queue (not a


    shared one) and this would therefore get deleted when the subscriber disconnected.




    Try this:




    SUBSCRIBE


    destination:/topic/high.*


    ack:client-individual


    id:subscribe-03


    persistent:true




    ^@




    and then use exactly the same subscription after reconnect to receive messages.




    You should UNSUBSCRIBE (see the doc) when this is no longer needed, or the


    queue may stay around for a long time.




    At present you cannot create a durable subscription to an /exchange/<x-name>/<r-key>


    destination.




    I hope this helps you: please let us know how you get on.




    Steve Powell [M: +44-7815-838-558; H:+44-1962-775-598; W:+44-2380-111-528]


         What I tell you three times is true.


    Lewis Carroll; Hunting of the Snark: Fit the First




    On 14 Jan 2014, at 05:08, joshua__lim <[hidden email]> wrote:



    I read somewhere that says to create durable subscription for exchange, I'd
    need to set the client-id header on the CONNECT and the id header to a
    unique string and set persistent: true. This doesn't appear to work at this
    moment as subscribed-clients will lose messages sent to the exchange if they
    are not connected.



    _______________________________________________


    rabbitmq-discuss mailing list


    [hidden email]


    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss






















       If you reply to this email, your message will be added to the discussion below:
       http://rabbitmq.1065348.n5.nabble.com/Federation-and-Stomp-tp20052p32562.html






       To unsubscribe from Federation and Stomp, click here.


       NAML








    --
    View this message in context: http://rabbitmq.1065348.n5.nabble.com/Federation-and-Stomp-tp20052p32616.html
    Sent from the RabbitMQ mailing list archive at Nabble.com.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140115/76f1b0d9/attachment.html>
  • Joshua__lim at Jan 14, 2014 at 5:09 am
    ps: for follow up email






    --
    View this message in context: http://rabbitmq.1065348.n5.nabble.com/Federation-and-Stomp-tp20052p32537.html
    Sent from the RabbitMQ mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedFeb 15, '12 at 3:29p
activeJan 16, '14 at 3:18a
posts7
users4
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase