-
March 16th, 2016, 06:06 PM
#1
Developing & Running an Adapter Set Using Eclipse [Java]
Follow these instructions for developing and running an Adapter Set using Eclipse:
- Create a new Java Project
- Add the ls-bootstrap.jar and ls-adapter-interface.jar files taken from <lightstreamer_install_dir>/lib to the Build Path
- Develop the custom Adapter Set (see docs)
- Create a new folder into <lightstreamer_install_dir>/adapters, for example my_adapter
- 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)
- 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)
- 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.
-
December 12th, 2016, 04:13 AM
#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).
-
December 13th, 2016, 09:01 AM
#3
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
-
December 13th, 2016, 02:24 PM
#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 02:32 PM.
-
December 14th, 2016, 09:01 AM
#5
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
-
December 14th, 2016, 10:35 AM
#6
Hi Mr Gianluca.finocchiaro,
Thank you so much for your help, I did, it's running well now. Thanks again!
-
December 15th, 2016, 04:33 AM
#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!
-
December 15th, 2016, 09:41 AM
#8
Hi nttam,
could you please provide us with some examples of error in terms of sent and received data?
Thanks
Gianluca
-
December 16th, 2016, 03:26 AM
#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 thông tin khách hàng thành công.
-
December 16th, 2016, 08:51 AM
#10
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
-
By Priyanka in forum Adapter SDKs
Replies: 6
Last Post: May 3rd, 2016, 04:12 PM
-
By lizamare in forum Adapter SDKs
Replies: 1
Last Post: April 17th, 2015, 09:59 AM
-
By msgiribabu in forum Adapter SDKs
Replies: 2
Last Post: January 31st, 2011, 11:32 AM
-
By gengliangyu2008 in forum General
Replies: 2
Last Post: November 10th, 2010, 10:40 AM
-
By k.mcc2009 in forum Adapter SDKs
Replies: 1
Last Post: May 21st, 2009, 09:41 AM
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 12:11 PM.
Bookmarks