How to to an RPC call in new versions of langohr

28 views
Skip to first unread message

Денис Давыдов

unread,
Jun 18, 2018, 6:28:55 AM6/18/18
to clojure-rabbitmq
Hello everybody

I tried to find the documentation to do the rpc calls in langohr. The only one that I found is https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/clojure but this uses blocking-subscribe function, which is not included to the latest version of langohr. Is there any documentation to make RPC calls for the later version?

Michael Klishin

unread,
Jun 18, 2018, 7:13:35 AM6/18/18
to clojure-...@googlegroups.com
The same way e.g. Java client does it in tutorial 6.

blocking-subscribe
was removed because it relied on QueueingConsumer, which doesn't do much beyond
enqueueing all deliveries into a local LinkedQueue and providing an iterator-like interface.

j.u.c.CountDownLatch with counter set to 1 is a common way to await an event if you really have to block.

On Mon, Jun 18, 2018 at 1:28 PM, Денис Давыдов <denis....@gmail.com> wrote:
Hello everybody

I tried to find the documentation to do the rpc calls in langohr. The only one that I found is https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/clojure but this uses blocking-subscribe function, which is not included to the latest version of langohr. Is there any documentation to make RPC calls for the later version?

--
You received this message because you are subscribed to the Google Groups "clojure-rabbitmq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-rabbitmq+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Jun 18, 2018, 7:38:45 AM6/18/18
to clojure-...@googlegroups.com
In other words, the request/reply pattern depends on consumers keeping track of request IDs (stored in the correlation-id message property)
and servers including that ID into their response. Whether client calls are blocking or not and how exactly the blocking part
is enforced is an implementation detail.

Clojure futures, j.u.c. Futures and CountDownLatch can all be useful tools in that area.

Денис Давыдов

unread,
Jun 18, 2018, 8:22:34 AM6/18/18
to clojure-rabbitmq


понедельник, 18 июня 2018 г., 14:38:45 UTC+3 пользователь Michael Klishin написал:
In other words, the request/reply pattern depends on consumers keeping track of request IDs (stored in the correlation-id message property)
and servers including that ID into their response. Whether client calls are blocking or not and how exactly the blocking part
is enforced is an implementation detail.

Clojure futures, j.u.c. Futures and CountDownLatch can all be useful tools in that area.
On Mon, Jun 18, 2018 at 2:13 PM, Michael Klishin <mkli...@pivotal.io> wrote:
The same way e.g. Java client does it in tutorial 6.

blocking-subscribe
was removed because it relied on QueueingConsumer, which doesn't do much beyond
enqueueing all deliveries into a local LinkedQueue and providing an iterator-like interface.

j.u.c.CountDownLatch with counter set to 1 is a common way to await an event if you really have to block.
On Mon, Jun 18, 2018 at 1:28 PM, Денис Давыдов <denis....@gmail.com> wrote:
Hello everybody

I tried to find the documentation to do the rpc calls in langohr. The only one that I found is https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/clojure but this uses blocking-subscribe function, which is not included to the latest version of langohr. Is there any documentation to make RPC calls for the later version?

--
You received this message because you are subscribed to the Google Groups "clojure-rabbitmq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-rabbit...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Thank you for the answer. I'm quite new in RabbitMQ in general, Is there any example clojure code? 

Michael Klishin

unread,
Jun 18, 2018, 8:38:16 AM6/18/18
to clojure-...@googlegroups.com
I'm not aware of any. There are examples for plenty of other clients, including Java [1].


To unsubscribe from this group and stop receiving emails from it, send an email to clojure-rabbitmq+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Денис Давыдов

unread,
Jun 18, 2018, 8:45:35 AM6/18/18
to clojure-rabbitmq
Thank you. Will try to transform it to Clojure
Reply all
Reply to author
Forward
0 new messages