Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147

    Developing & Running an Adapter Set Using Eclipse [Java]

    Follow these instructions for developing and running an Adapter Set using Eclipse:

    1. Create a new Java Project
    2. Add the ls-bootstrap.jar and ls-adapter-interface.jar files taken from <lightstreamer_install_dir>/lib to the Build Path
    3. Develop the custom Adapter Set (see docs)
    4. Create a new folder into <lightstreamer_install_dir>/adapters, for example my_adapter
    5. Create the adapters.xml file into <lightstreamer_install_dir>/adapters/my_adapter folder, in which you specify the class names for your Metadata and Data Adapters (see inline documentation under <lightstreamer_install_dir>/DOCS-SDKs/sdk_adapter_java_inprocess/doc/adapter_conf_template/adapters.xml file)
    6. If the Adapter leans on any external libraries, add them to the Build Path as well (in the final deployment you will have to put them under <lightstreamer_install_dir>/adapters/my_adapter/lib)
    7. From the newly created Java Project, create a new run configuration (right click -> Run Configurations...), with the following settings:
      • Main class: com.lightstreamer.LS
      • Program Arguments: conf/lightstreamer_conf.xml
      • Working Directory: ${LS_HOME}
      • VM Arguments:
        Code:
        -Xmx2048M
        -ea
        -Dcom.lightstreamer.kernel_lib_path=${LS_HOME}/lib/lightstreamer.jar
        -Dcom.lightstreamer.internal_lib_path="${LS_HOME}/lib/ls-monitor.jar";"${LS_HOME}/lib/core/*";"${LS_HOME}/lib/mpn/*";"${LS_HOME}/lib/mpn/apns/*";"${LS_HOME}/lib/mpn/gcm/*"
        -Dcom.lightstreamer.logging_lib_path="${LS_HOME}/lib/ls-logging-utilities.jar";"${LS_HOME}/lib/log/*"
        -Dcom.lightstreamer.database_lib_path="${LS_HOME}/lib/mpn/hibernate/*";${LS_HOME}/lib/lightstreamer.jar

      where LS_HOME is a new variable defined in the run configuration (through the Variables.. button), whose value is the absolute path of the Lightstreamer Server installation directory (<lightstreamer_install_dir>).
      Configure the -Xmx value as per your requirement.
      In addition, pay attention to the path separator, which has to be replaced by ":" in case of unix-like machines.

    After that, save the configuration (click on Apply button) and run it to execute the customer
    Adapter Set inside the Lightstreamer Server instance. For debugging, simply launch the configuration through the Debug button.

  2. #2
    Hi Mr Gianluca.finocchiaro ,
    I have a java project with some adapters and a common class that share info between these adapters, could you show me how to export (as jar file) then upload to adapter folder in lightstreamer server for running as well as a project, not independently adapters.
    p/s this project can running oke by source (run configuration as your guild above).

  3. #3
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi nttam,

    I'm sorry but it is not clear to me what you mean by "not independently adapters". If you have already prepared the adapter folder (where also the appropriate adapters.xml is expected to be there), you have to export the eclipse project as jar file (right click and then "Export..."->"JAR file) and put it into the "lib" subfolder.

    Please let me know if you are already aware of that information, or you are asking for something different.

    Thanks and Regards,
    Gianluca

  4. #4
    Hi Mr Gianluca.finocchiaro,
    Thanks very much for your quickly reply. I've already exported project as jar file and put it into "lib" subfolder of each adapter folder, note that I have some adapter in adapters folder parent. The lightstreamer server start ok, but these adapter run separated. How make it run as an application which these adapter can use and share some common class or global variable also?
    Last edited by nttam; December 13th, 2016 at 03:32 PM.

  5. #5
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi nttam,

    provided that you left the <classloader> value to its default value ("common") in the adapters.xml files relative to the involved Adapter Sets, you have to put common classes and libraries into the "shared/lib" and/or "shared/lib" folders of your Lightstreamer installation: please have a look at all README.txt files you can find here (even inside "classed" and "lib" subfolders").

    Please also look at inline documentation of the <classloader> tag you can find here.

    Hope this helps.

    Thanks and Regards,
    Gianluca

  6. #6
    Hi Mr Gianluca.finocchiaro,
    Thank you so much for your help, I did, it's running well now. Thanks again!

  7. #7
    Hi Mr Gianluca.finocchiaro,
    One more time, Its running ok now, but data is error font with unicode (I run by source code that font ok), maybe I need to config unicode utf-8 for lightstreamer server? if need, could you show me how to config? thanks!

  8. #8
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi nttam,

    could you please provide us with some examples of error in terms of sent and received data?

    Thanks
    Gianluca

  9. #9
    Hi Mr Gianluca.finocchiaro,
    That error happen when received message from midleware at adapter, as this example: Data -> var_fr6: [V010103]: Tra cứu dữ li?u th nh công. but when running by source code its ok: [V010103]: Tra cứu thng tin khch hng thnh cng.

  10. #10
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    147
    Hi nttam,

    just to clarify the current scenario: the middleware sends "data" to the adapter and, from there, are forwarded to the clients, is it correct? So, on the client side such data appear in a wrong format. Please confirm my understanding, since we need to identify where the potential encoding/decoding issue really occurs.

    Thanks,
    Gianluca

 

 

Similar Threads

  1. How can I set the listener in the Data adapter?
    By Priyanka in forum Adapter APIs
    Replies: 6
    Last Post: May 3rd, 2016, 05:12 PM
  2. Replies: 1
    Last Post: April 17th, 2015, 10:59 AM
  3. how to create Adapter Set
    By msgiribabu in forum Adapter APIs
    Replies: 2
    Last Post: January 31st, 2011, 12:32 PM
  4. How to config eclipse to debug lightstreamer.
    By gengliangyu2008 in forum General
    Replies: 2
    Last Post: November 10th, 2010, 11:40 AM
  5. Replies: 1
    Last Post: May 21st, 2009, 10:41 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 06:34 PM.