Behavior of WL.server.createEventSource on a Worklight Cluster Environment

210 views Asked by At

Let's assume I have a cluster of 2 worklight servers sharing the same WL runtime.

On that runtime, I've installed a application with a adapter that is a create event source function.

Just like this IBM article. https://www.ibm.com/developerworks/community/blogs/worklight/entry/configuring_a_polling_event_source_to_send_push_notifications?lang=en

My question is, what will happen on a cluster environment. Will repeated work ensue? By other words, would my two WL Servers will be pooling for events?

Or perhaps that functionality is writing a task on the WL DB that the WL Servers poll regularly to check for work if no instance is taking care of it, so that only a server at a time would be "the event source"?

I'm working with IBM Worklight 6.2 and Websphere Liberty Profile 8.5.5

Thanks in advance!

1

There are 1 answers

1
Idan Adar On BEST ANSWER

Here's my attempt to answer this after some consultation:

My question is, what will happen on a cluster environment. Will repeated work ensue? By other words, would my two WL Servers will be pooling for events?

While the Worklight Servers share the same runtime, they are still considered as 2 instances. This means that each of them will attempt to perform a polling action. This is considered OK.

However, it is important to note that the backend system that is being polled should likely be smart enough to handle such a situation where 2 polling attempts are done for the same message.

If the backend doesn't know how to handle polling properly, the same message can be pulled more than once. This is true even of you have a single eventsource running. So this is something to keep in mind.