-
May 10th, 2019, 10:14 PM
#1
Subscribed item format
Hi
I'm coding an adapter based on the stock list demo and I am using a modified version of the python client for stock list demo to test it. Problem is that we have items with the following format: [digits]:[digits or letters]. In the adapters.xml I have:
When I use the python client to subscribe an item like "10:100000090003" I got the following error at the server log:
10-mai-19 17:59:39,867|INFO |L.requests |SERVER POOLED THREAD 1 |Refused request: Metadata Provider refusal: Mode MERGE is not supported for item 10:100000090003 on "Lightstreamer HTTP Server" from 127.0.0.1:55618
The python client also receive an error from the server.
When I try other regular expressions like this very permissive ".*:.*" I got another error:
0-mai-19 18:02:56,751|ERROR|L.subscriptions |SERVER POOLED THREAD 7 |Subscription error for item 10:100000090003 on CDS_ADAPTER.QOMET_ADAPTER: Unexpected item: 10:100000090003
In this case, the python client doesn't receive an error.
What's wrong here? The regex? The item format? I didn't found a documentation about item format. If there is one please point me to the right direction.
Our adapter is already working if we update/subscribe items with names like the demo ("item1", "item2" or "test") but we really need to use items with the format specified above.
Thanks in advance!
Last edited by EmersonPardo; May 10th, 2019 at 10:25 PM.
-
May 13th, 2019, 11:13 AM
#2
This technique of the "item families" is just an example of how you can implement modeMayBeAllowed in your Metadata Adapter.
Perhaps, its generic resort to configurable regular expressions is not the best approach for your case.
By the way, you can see the source code here.
That said, in the ^d+:.* regular expression you should add a backslash before the d.
If the test passes, the item is assigned MERGE mode and is submitted to the Data Adapter's subscribe().
At this point, the item name is already accepted. If the Data Adapter finds it unexpected, it cannot inform the client, as this is only a Metadata Adapter fault, as the Metadata Adapter should allow only items meaningful to the Data Adapter.
In your case (which happens with the permissive regular expression) the "Unexpected item" message is issued by the Data Adapter of the StockList Demo.
If you want to use your item names, you should code your Data Adapter. For testing purpose, you can modify the StockList Demo Data Adapter, starting from this project.
-
May 13th, 2019, 01:45 PM
#3
Hello Dario, thank you for your answer.
In fact, my code modify the StockList Demo Data Adapter already.
Problem is I forgot to modify the subscribe method accordingly so it was rejecting any string that isn't starting with "item".
Thank you again.
Similar Threads
-
Replies: 4
Last Post: February 11th, 2020, 12:11 PM
-
By alexreinert in forum Client SDKs
Replies: 2
Last Post: July 21st, 2015, 10:35 AM
-
By hungtt in forum Adapter SDKs
Replies: 2
Last Post: December 24th, 2010, 07:51 AM
-
By tuongkha in forum Client SDKs
Replies: 9
Last Post: July 9th, 2008, 09:27 AM
-
By rsouissi in forum Adapter SDKs
Replies: 4
Last Post: January 10th, 2007, 06:11 PM
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 11:31 PM.
Bookmarks