[OpenSIPS-Devel] [NEW] EVENT VIRTUAL Module - failover & balancing for event backends

Robert Vlad Patrascu rvlad.patrascu at gmail.com
Fri Sep 25 13:39:06 CEST 2015


The new event_virtual module addresses the problem of reliability for
events delivery. Previously, the modules generating and sending events had
first of all no way to find the sending was successful or not, and even
more there was no available mechanism to do failover to a another backend
(i.e. figure out if event delivery via rabbitmq failed and if so, try to
deliver the event via datagram or text file).

The event_virtual module provides a solution for detecting the failure of
events delivery and for doing the failover. Even more, beside failure
handling, the module addresses the issue of load balancing (or dispatching)
for events across multiple backends.

Shortly, the new event_virtual module provides the possibility to create
virtual backends for the OpenSIPS Event Interface. A virtual backend can
aggregate multiple real backends (transport protocols that are implemented
by different OpenSIPS modules) such as: event_xmlrpc, event_rabbitmq,
event_datagram or event_flatstore etc.

The main advantage brought by this module is that when an event is
triggered, the virtual module pushes the event to the read backends with
three different policies which can be specified in the virtual subscription
socket.Those policies are:
* parallel - the event is pushed to all defined backends at the same time;
* failover - for every event raised, try the backends in the order in which
they
  are given in the virtual socket, until the first successful delivery;
* round-robin - for every event raised, use the backends alternatively, in
the order in
  which they are given (for each raised event notify a different backend).

For example, if we don't want to lose event notifications in case one of
the registered external applications fails, we can set up other backend to
deliver the event.The virtual socket could be:

virtual:FAILOVER rabbitmq:guest:guest at 127.0.0.1:5672/pike
flatstore:/var/log/opensips.log

Another scenario could be if we want to do some "load balancing" if we
receive too many events to one subscriber.The socket could be:

virtual:ROUND-ROBIN udp:127.0.0.1:8081 xmlrpc:127.0.0.1:8080:block_ip

For more details, take a look at the module readme:
http://www.opensips.org/html/docs/modules/2.2.x/event_virtual.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150925/156a1a54/attachment.htm>


More information about the Devel mailing list