Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Replicated messaging in Erlang?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Adam Warski  
View profile  
 More options Jul 27 2012, 6:47 am
From: Adam Warski <a...@warski.org>
Date: Fri, 27 Jul 2012 12:47:31 +0200
Local: Fri, Jul 27 2012 6:47 am
Subject: [erlang-questions] Replicated messaging in Erlang?
Hello,

I've been looking at the Erlang ecosystem, and coming from a Java world, I am wondering what is the "Erlang way" to implement the following.

The use case is very simple: I want to receive requests from users, and later process them asynchronously. However I want to be sure that if a request is received, it will be safe from single-node crashes, in other words, I want requests to be replicated across my cluster.

In Java I would implement it using a replicated message queue. However RabbitMQ doesn't have replicated queues, only the meta-data is clustered (as far as I know). Mnesia has replication, but then it is a database, not a queue (although you could probably implement a mq ontop od that, but I didn't see anybody doing that).

So how would you implememt this in Erlang? :)

Regards,
Adam Warski
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francesco Mazzoli  
View profile  
 More options Jul 27 2012, 7:19 am
From: Francesco Mazzoli <f...@mazzo.li>
Date: Fri, 27 Jul 2012 12:19:30 +0100
Local: Fri, Jul 27 2012 7:19 am
Subject: Re: [erlang-questions] Replicated messaging in Erlang?
At Fri, 27 Jul 2012 12:47:31 +0200,

Adam Warski wrote:
> However RabbitMQ doesn't have replicated queues, only the meta-data is
> clustered (as far as I know).

RabbitMQ *does* have replicated (High Availability) queues:
http://www.rabbitmq.com/ha.html .

--
Francesco * Often in error, never in doubt
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CGS  
View profile  
 More options Jul 27 2012, 7:24 am
From: CGS <cgsmcml...@gmail.com>
Date: Fri, 27 Jul 2012 13:24:29 +0200
Local: Fri, Jul 27 2012 7:24 am
Subject: Re: [erlang-questions] Replicated messaging in Erlang?

Hi Adam,

If I understood correctly your question, there are two points there:
1. how you can replicate a message;
2. how you can be sure that the message is received.

If that is the case, here are few simple answers (hopefully, more skilled
Erlang users will come with better ideas/solutions):

1. Take a look at gproc or any equivalent implementation.

2. That depends on how the message is sent, but the general solution is to
have a reply from the receiver. Here are two simple solutions for doing
that:

a) Message sent via threads messaging (Pid ! MyMessage):
-> sender: ReceiverPid ! {self(), MyMessage}
-> receiver listener (basics only):
receive
    Message -> {SenderPid, SenderMessage} = Message, SenderPid ! received
    ...
end
or you can add SenderPid in the group of receivers.

b) Message sent via TCP connection (for the receiver only; the sender
should have also a listener to be able to receive the answer):
listen_socket(Socket) ->
    case gen_tcp:recv(Socket, 0) of
          {ok,Data} ->
              gen_tcp:send(Socket,<<"received">>),
              listen_socket(Socket);
         ...
    end.

These are only few basic options. Of course, there are many other options
(e.g., monitoring your receiver). I resume my answer to a simple one. Take
care of the length of the queue (if you need a personalized queue, I
suggest gen_fsm).

I hope this answer helps and if I misunderstood your problem, I kindly ask
you to ignore my answer.

CGS

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Warski  
View profile  
 More options Jul 27 2012, 2:14 pm
From: Adam Warski <a...@warski.org>
Date: Fri, 27 Jul 2012 20:14:39 +0200
Local: Fri, Jul 27 2012 2:14 pm
Subject: Re: [erlang-questions] Replicated messaging in Erlang?
Thanks, not sure how I could have missed that :)

So, you would use mirrored queues in that use-case?

Regards,
Adam Warski

On 27 lip 2012, at 13:01, Adam Rutkowski <adam.rutkow...@jtendo.com> wrote:

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Warski  
View profile  
 More options Jul 27 2012, 2:27 pm
From: Adam Warski <a...@warski.org>
Date: Fri, 27 Jul 2012 20:27:41 +0200
Local: Fri, Jul 27 2012 2:27 pm
Subject: Re: [erlang-questions] Replicated messaging in Erlang?
Thank you for the answer,

On 27 lip 2012, at 13:24, CGS <cgsmcml...@gmail.com> wrote:

> Hi Adam,

> If I understood correctly your question, there are two points there:
> 1. how you can replicate a message;
> 2. how you can be sure that the message is received.

> If that is the case, here are few simple answers (hopefully, more skilled Erlang users will come with better ideas/solutions):

> 1. Take a look at gproc or any equivalent implementation.

Thanks, looks quite big, but I'll try to dig through it. Though it's not only replicating the message, it's also consuming the message across the cluster once it is consumed on the master node, etc.

Regards,
Adam Warski
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Watson  
View profile  
 More options Jul 28 2012, 10:03 am
From: Tim Watson <watson.timo...@gmail.com>
Date: Sat, 28 Jul 2012 15:03:26 +0100
Local: Sat, Jul 28 2012 10:03 am
Subject: Re: [erlang-questions] Replicated messaging in Erlang?
Adam, please take some time to walk through the rabbitmq documentation - there's quite a lot of it! Rabbit supports replication using HA (master/slave mirror) queues, or federation for replicating over the WAN/Internet. This does exactly what you've asked for.

If you'd like to understand how it works, take a lot at gm.erl (guaranteed multicast) which is a fully asynchronous ring protocol developed independently at rabbit to support HA.

Cheers.
Tim

On 27 Jul 2012, at 19:27, Adam Warski <a...@warski.org> wrote:

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Warski  
View profile  
 More options Jul 30 2012, 10:38 am
From: Adam Warski <a...@warski.org>
Date: Mon, 30 Jul 2012 16:38:46 +0200
Local: Mon, Jul 30 2012 10:38 am
Subject: Re: [erlang-questions] Replicated messaging in Erlang?

> Adam, please take some time to walk through the rabbitmq documentation - there's quite a lot of it! Rabbit supports replication using HA (master/slave mirror) queues, or federation for replicating over the WAN/Internet. This does exactly what you've asked for.

I did some time ago, but either the docs got improved, or I just skipped a whole paragraph after reading "An exception to this are message queues, which by default reside on the node that created them, though they are visible and reachable from all nodes.". Anyway, all is clear now :).

> If you'd like to understand how it works, take a lot at gm.erl (guaranteed multicast) which is a fully asynchronous ring protocol developed independently at rabbit to support HA.

Thanks for the pointer!

Adam

--
Adam Warski

http://twitter.com/#!/adamwarski
http://www.softwaremill.com
http://www.warski.org

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »