[rabbitmq-discuss] Send durable messages

Kaveh Shahbazian kaveh.shahbazian at gmail.com
Thu Dec 12 07:45:06 GMT 2013


Many thanks to you! That worked! Of-course it's strange why there is so
little Erlang samples for RabbitMQ! :)

Kaveh Shahbazian
“Walking on water and developing software from a specification are easy if
both are frozen.”
― Edward Berard
<http://goo.gl/ZZ2TMu>
<http://stackoverflow.com/users/54467/kaveh-shahbazian>


On Thu, Dec 12, 2013 at 1:51 AM, Alvaro Videla <videlalvaro at gmail.com>wrote:

> Hi,
>
> You need to set the delivery_mode = 2
>
> See
> https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/erlang/new_task.erl#L22
>
> Regards,
>
> Alvaro
>
> On Wed, Dec 11, 2013 at 8:54 PM, Kaveh Shahbazian
> <kaveh.shahbazian at gmail.com> wrote:
> > Hi, I want to send durable messages. But when I add 'durable = true' in
> > publish or message it complains that there is no such field in that
> record.
> >
> > here is my code:
> >
> > send() ->
> >     {ok, Connection} = amqp_connection:start(#amqp_params_network{ host =
> > "localhost" }),
> >     {ok, Channel} = amqp_connection:open_channel(Connection),
> >
> >     amqp_channel:call(Channel, #'queue.declare'{queue = <<"q1_queue">>,
> > durable = true}),
> >     amqp_channel:cast(Channel,
> >                       #'basic.publish'{
> > exchange = <<"">>,
> > routing_key = <<"q1_queue">>
> > },
> >                       #amqp_msg{
> > payload = <<"Hello World!">>
> > }),
> >     io:format(" [x] Sent 'Hello World!'~n"),
> >     ok = amqp_channel:close(Channel),
> >     ok = amqp_connection:close(Connection),
> >     ok.
> >
> > Thanks;
> >
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> >
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131212/b1c76448/attachment.html>


More information about the rabbitmq-discuss mailing list