Getting last message in stream

410 views
Skip to first unread message

Lars Riis Olsen

unread,
Sep 9, 2021, 6:26:20 AM9/9/21
to rabbitmq-users
Hi,

When using the stream libraries you can subscribe the the last message in the stream (OffsetSpecification.LAST in the java client). Does anyone know if something similar possible when using the normal AMQP libraries or whether this is specific to the stream protocol libaries?

Michal Kuratczyk

unread,
Sep 9, 2021, 7:08:19 AM9/9/21
to rabbitm...@googlegroups.com
Hi,

It is specific to Streams. You didn't say why you would like to do that with a queue but perhaps https://github.com/rabbitmq/rabbitmq-lvc-exchange is what you are looking for?
In some use cases, it allows clients to receive the last message that was published, so that if there is something that periodically updates the status, a new client will get the last value without waiting for the next update.

Best,

On Thu, Sep 9, 2021 at 12:26 PM Lars Riis Olsen <lro...@live.com> wrote:
Hi,

When using the stream libraries you can subscribe the the last message in the stream (OffsetSpecification.LAST in the java client). Does anyone know if something similar possible when using the normal AMQP libraries or whether this is specific to the stream protocol libaries?

--
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 view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/3af62f7b-0bcb-4dce-8c2c-9d637776f22an%40googlegroups.com.


--
Michał
RabbitMQ team

Lars Riis Olsen

unread,
Sep 9, 2021, 8:07:41 AM9/9/21
to rabbitmq-users
Aah, maybe I wasn't clear enough. I have a stream. I just want to be able to get the most recently appended message to it. In the stream protocol libraries I can see that there is 'OffsetSpecification.Last' that can be used as an offset. However, I am on a language without stream protocol client (python) so I need to do it with the normal AMQP clients (pika in my case). Is that possible?

Arnaud Cogoluègnes

unread,
Sep 9, 2021, 8:16:34 AM9/9/21
to rabbitmq-users
Using "x-stream-offset" with "last" should to the trick [1].

Reply all
Reply to author
Forward
0 new messages