Results 1 to 10 of 16

Hybrid View

  1. #1
    Hi Giuseppe,
    I've sent logs and some files by email.
    I have this adapter where I’ve just renamed the class and is the same as the adapter here (https://github.com/Lightstreamer/Lig...d-adapter-java)
    I run the lighstreamer server, and I run a LS client to connect to it (but don’t have the adapter compatible with it yet)
    I have this code for my customed adapter MARKETDATASETADAPTER
    public MarketDataSetAdapter() {
    logger.warn("MARKETDATASETADAPTER CONSTRUCTOR");
    try {
    FileWriter myWriter = new FileWriter("/tmp/filename.txt");
    myWriter.write("Files in Java might be tricky, but it is fun enough!");
    myWriter.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    }


    Question 1: The code above is never called. When does the adapter constructor is called? And where logger writes the adapter logs

    Question 2:
    In the lightstreamer.log, when I connect to the client, I see this:
    815
    OK
    Then
    ERROR
    17
    Data Adapter not found

    Question 3:
    I have several: ExtendedTableInfo with different types of extendedTableInfo.setDataAdapter() in the LS client im using. In adapters.xml file I was using my customs adapters by adding those in <data_provider . But the LS client wasn’t working unless I put the adapter class name im using in <adapters_conf id=.
    What is the difference between an adapter and a dataprovider? Can I have several adapters (<adapters_conf id) in In adapters.xml?

    Thanks

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi baalbaki,

    1) The adapter constructor is called in the initialization phase of the server, looking in the server log (lightstreamer.log) you attached the relevant log lines are:

    Code:
    01-Feb-22 17:46:51,352|DEBUG|L.i.subscriptions  |main                       |Found Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,352|DEBUG|L.i.subscriptions  |main                       |Initializing Adapters...
    01-Feb-22 17:46:51,353|INFO |L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter for Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter class com.lightstreamer.adapters.metadata.LiteralBasedProvider for MARKETDATASET
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter MARKETDATASET from ClassLoader  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / Adapters / MARKETDATASET Adapter Set
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Adding class com.lightstreamer.adapters.metadata.LiteralBasedProvider from  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / com.lightstreamer.l.b.a.aa / com.lightstreamer.l.b.a.aa for metadata adapter...
    01-Feb-22 17:46:51,355|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Class for metadata adapter successfully added.
    01-Feb-22 17:46:51,355|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Initializing Metadata Adapter for Adapter Set MARKETDATASET; class = com.lightstreamer.adapters.metadata.LiteralBasedProvider; params = {item_family_1=item.*, adapters_conf.id=MARKETDATASET, modes_for_item_family_1=MERGE}; dir = /export/tbricks/nbf_java/CandealSimulator/simulator/conf/../adapters/welcome_res
    01-Feb-22 17:46:51,356|INFO |L.i.subscriptions  |Init for MARKETDATASET     |Finished loading Metadata Adapter for Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,356|INFO |L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter MARKETDATASET.MARKETDATASET
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter class main.java.com.lightstreamer.adapters.MarketDataSetAdapter for MARKETDATASET
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter MARKETDATASET from ClassLoader  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / Adapters / MARKETDATASET Adapter Set
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Adding class main.java.com.lightstreamer.adapters.MarketDataSetAdapter from  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / com.lightstreamer.l.b.a.aa / com.lightstreamer.l.b.a.aa for data adapter...
    01-Feb-22 17:46:51,357|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Class for data adapter successfully added.
    01-Feb-22 17:46:51,531|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Initializing Data Adapter MARKETDATASET.MARKETDATASET; class = main.java.com.lightstreamer.adapters.MarketDataSetAdapter; params = {data_provider.name=MARKETDATASET, adapters_conf.id=MARKETDATASET}; dir = /export/tbricks/nbf_java/CandealSimulator/simulator/conf/../adapters/welcome_res/MarketDataSetAdapter
    01-Feb-22 17:46:51,531|INFO |L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Finished loading Data Adapter MARKETDATASET.MARKETDATASET
    So your class main.java.com.lightstreamer.adapters.MarketDataSet Adapter seems properly instantiated.So your class main.java.com.lightstreamer.adapters.MarketDataSet Adapter seems properly instantiated.
    From your log I understand that you use Log4j2 for the adapter log, in that case the log configuration should be provided in a file with name log4j2.xml in the classpath.
    Please consider as a reference the file log4j2.xml in the classes folder of the deploy.zip of this example (https://github.com/Lightstreamer/Lig...tag/new_deploy).
    After you will get the log of your adapter we will be able to understand what is wrong with the constructor code.

    2) The subscription request specifies the STATICDATA_ADAPTER Data Adapter that is non deployed based on the adapters.xml attached.

    /lightstreamer/control.txt --> LS_mode=MERGE&LS_session=Sf8349f30dd39d043M777T473 6262&LS_Snapshot=true&LS_id=SecSubType&LS_schema=S ecurityTypeList&LS_data_adapter=STATICDATA_ADAPTER&LS_table=1&LS_op=add on "Lightstreamer HTTP Server" from 127.0.0.1:35158


    3) No, the <adapters_conf id=" ... "> must be unique within the adapters.xml file as it represents the identification of the Adapter Set.
    An Adapter Set is made up of a Metadata Adapter and one or multiple Data Adapters (Data Provider and Data Adapter are synonymous).
    The Adapter Set is defined in the adapters.xml configuration file and in particular the Metadata Adapter in the <metadata_provider> section.
    And the Data Adapters each in its own section <data_provider name=" ... ">.

    You can also have several Adapters Sets deployed on the same Lightstreamer server, but you need to provide different adapters.xml in different sub-folders of <LS_HOME>/adapters/.

    Regards,
    Giuseppe

 

 

Similar Threads

  1. LightStreamer Server Failing Upon A Connection
    By ErikLatimer in forum General
    Replies: 3
    Last Post: October 3rd, 2018, 12:06 PM
  2. Replies: 1
    Last Post: June 13th, 2016, 10:01 AM
  3. Replies: 5
    Last Post: January 18th, 2016, 10:10 AM
  4. Internal cause codes & Session callbacks
    By jonasby1 in forum General
    Replies: 4
    Last Post: February 16th, 2012, 08:47 AM
  5. Internal cause codes
    By BKnight in forum General
    Replies: 3
    Last Post: February 10th, 2012, 09:33 AM

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 01:45 PM.