Custom Service needs to avoid message duplication when runni

Posted by Barnesm72 on 29-Jul-2011 09:56

We have a custom service written for logging purposes.  Our domains are clustered for failover and we have a primary and backup copy of the service running.

If both services get set to active, we have situations where messages are being duplicated.

Is there any documentation or examples for a service on how to avoid duplicate messages on a dual active state?

All Replies

Posted by pmeadows on 29-Jul-2011 10:45

By default, Sonic ESB uses 'shared subscribers' (aka 'group subscriptions') for services listening on topic-based entry endpoints.  If you deploy a given service into several containers then the listeners for that service are all members of the same 'group', so messages are shared between the listeners.  In other words, if the same service is deployed into two containers, any given message will be delivery to just one instance of the service.

Therefore I'm not entirely sure why you're seeing duplicate messages even if both the instances of the service are active.

Are the "primary and backup [copies] of the service" the exact same service deployed to two containers?  Or do you have two separate services (a primary one and backup one) created from the same service type and each deployed to a separate container?  The latter case might explain the duplicate messages.

Thanks, Paul.

Posted by Barnesm72 on 29-Jul-2011 10:49

That is correct, we have two services created from the same service type, each in its own container.  Service #1 is deployed on the first node of the cluster, and service #2 is deployed on the backup node for failover purposes.

Posted by pmeadows on 29-Jul-2011 11:18

Can you reorganise things so that you deploy two instances of the same service rather than two distinct services?

Another option might be to use a queue-based endpoint rather than a topic-based one.

I was also considering whether you could manually make use of shared subscriptions to achieve what you're after.  For example disabling the 'Shared Subscriptions' option in the endpoint's definition and instead adding a group prefix to the Destination Name.  But this seems messy and would likely introduce other limitations/problems (esp' around sending to the endpoint).  I wouldn't recommend this.

Posted by Barnesm72 on 29-Jul-2011 13:05

Is it possible to have more than one service recieve messages from a queue, I thought it was a 1:1 relationship?

Posted by Barnesm72 on 29-Jul-2011 13:08

Sorry, my descriptions are probably throwing you for a loop, the items in quesiton are not actual services, such as services listed on the Configured Objects screen.  They are actually ESB containers, hosted in MF containers.

Posted by pmeadows on 03-Aug-2011 10:56

Sorry for the delay in responding - I've been away from the office for a couple of days.

At this stage you're probably best raising the issue with Progress Technical Support (if you haven't already) so someone can take a more detailed look at your configuration.  From the brief outline in your last email it's not clear to me why you'd be seeing duplicate messages across the two containers.

Thanks, Paul.

This thread is closed