Results 1 to 3 of 3
  1. #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 11:25 PM.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    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.

  3. #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

  1. Replies: 4
    Last Post: February 11th, 2020, 01:11 PM
  2. How to format values on initial "update"
    By alexreinert in forum Client SDKs
    Replies: 2
    Last Post: July 21st, 2015, 11:35 AM
  3. Replies: 2
    Last Post: December 24th, 2010, 08:51 AM
  4. format value in VisualTable
    By tuongkha in forum Client SDKs
    Replies: 9
    Last Post: July 9th, 2008, 10:27 AM
  5. Adding/Removing item in subscribed group
    By rsouissi in forum Adapter SDKs
    Replies: 4
    Last Post: January 10th, 2007, 07:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:08 AM.