-
May 30th, 2018, 09:06 AM
#1
Hi Rajesh,
The SubscriptionException informs the server that the item is considered failed, and just as in the case of success the subscribe method will no longer be called until at least one active client keeps a subscription for that Item.
I think that the best practice to cope with such a scenario is that once the Data Adapter determines that the item name is valid, but an external service fails is to return succesfully the subscribe method an start a background task polling the external service at regular intervals.
If an unbsubscribe will be called before you got a reply from the external service the task will be cancelled.
Otherwise, if you want to avoid the background task, you should let communicate the Metadata Adapter with the Data Adapter, and replace the subsequent subscribe calls with the notifyNewTable calls.
Regards,
Giuseppe
-
May 30th, 2018, 02:09 PM
#2
HI Giuseppe,
Thanks for the quick reply,
I am going for the second option - communication between metaData and data adapter.
Is there a direct way to trigger the subscribe method of data adapter from notifyNewTable call, i could see Demos with volatile attributes which trigger the data pull for each item. Apart from that do you have any other recommendation for the communication.
Thanks
Rajesh
-
May 31st, 2018, 09:12 AM
#3
Hi Rajesh,
Yes you are right, the most convenient solution, especially in case of Java adapters, is that the Metadata holds a reference to the Data Provider instance, and perform direct calls when needed.
That said, please consider also the possibility that the Metadata call not the subscribe method but a different method in order to distinguish the two cases, the regular subscribe call from the Lightstreamer server, from Metadata incoming calls.
Regards,
Giuseppe
-
June 1st, 2018, 03:02 AM
#4
Thanks Giuseppe its acknowledged, I will make sure we have different method calls.
One question, is it possible to use spring Application events for metaData and data adapter communications? Implement ApplicationListener<ApplicationEvent> in our DATA Adapters so we can fire an application event from metaDataAdapter once notifyNewTables is called.
To put in simple words,
can we initialize spring context inside adapter life cycle classes ?
Thanks
Rajesh
Similar Threads
-
By sjohn in forum Client SDKs
Replies: 11
Last Post: January 23rd, 2015, 11:22 AM
-
By tstojano in forum Client SDKs
Replies: 1
Last Post: August 13th, 2008, 04:12 PM
-
By TonyRoberts in forum Adapter SDKs
Replies: 10
Last Post: September 12th, 2007, 02:46 PM
-
By Waddy in forum Client SDKs
Replies: 4
Last Post: May 14th, 2007, 02:38 PM
-
By Waddy in forum General
Replies: 2
Last Post: March 16th, 2007, 06:06 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 08:47 AM.
Bookmarks