-
February 1st, 2017, 08:25 AM
#1
Crate my custom Adapter using java for my existing application
We are having application already to display current commodity market price. Base rates we are getting from third party server and they are updating market current changes in XML file.(eg:- ratexml.xml).
And admin having panel to update some charges and commission, so we are updating that charges into database table, we are not updating all the current rates in table. Only having reference of commodity name in table and updating admin commission and charges into table.
And having one more service to combine charges with current rates and add some calculation and arriving one more xml file to display users(userratexml.xml). I have developed this application by using php. To generate userratexml.xml with current market price i have created one php file, in this i open the source xml(ratexml.xml) and admin charges and commissions stored in cache(used wincache) and perform some operation and finally sending response as xml format. For this i have created one service by using .net to call my php file for every 500 milliseconds.
For this to reduces external service calling from dot net service i planned to implement user page display stock prices in creating adapter itself. Is it possible to creating my php logic inside this adapter or shall I call php page for every second from adapter and assign value to adapter. Which one will be better? Please help any one to do this.
And also i have tried to create given stock sample adapter by using java. I couldn't run and check created sample java adapter code in eclipse. I used eclipse to create java adapter, its showing don't have main class. Please help for this also.
-
February 1st, 2017, 01:46 PM
#2
Hi rvkvino,
Have you considered the option of a stand-alone PHP Adapter that, in a continuous loop (with pauses), processes the userratexml.xml file and sends updates to Lightstreamer server?
A starting point could be this example (https://github.com/Lightstreamer/Lig...ld-adapter-php), where the generation of the message with the time and replaced by your calculations that lead to user rates.
About Java Adpater, please consider thtat a Java in-process Adapter does not need any main class since it is not a stand alone application, but it was loaded by Lightstreamer server in the initialization phase.
You could also refer to this thread, http://forums.lightstreamer.com/showthread.php?4875-Developing-amp-Running-an-Adapter-Set-Using-Eclipse-Java&highlight=debug+adapter, that explain how debug a Java Adapter in eclipse.
Regards,
Giuseppe
-
February 2nd, 2017, 05:18 AM
#3
So can i call the php page within javaadapter instead of writing login to create user rates inside the java file.
-
February 2nd, 2017, 09:55 AM
#4
Hi rvkvino,
Indeed, what I meant is a PHP stand alone program where you incorporate the PHP logic you developed to process current rates and add some calculation and arriving to user rates.
This could be used as a real Data Adapter without needs of Java.
That said, if you prefer a Java Adapter that that at regular intervals requests the user rates page, extract the information, and pushes them to Lightstreamer, I confirm that it is still a viable solution (maybe just a little more complex).
Regards,
Giuseppe
-
February 3rd, 2017, 09:58 AM
#5
Hi,
I have followed the above mentioned stand-alone PHP Adapter, But when i run the php file din't happens anything i have attached the screenshot of the both php and lightstreamer server run command. Please look on this issue and do the needful.
-
February 3rd, 2017, 12:08 PM
#6
Hi rvkvino,
the screenshots you uploaded are not very clear, could you please provide us with larger images?
Thanks and Regards,
Gianluca
-
February 3rd, 2017, 01:05 PM
#7
If i start the php server from command line it's not displaying anything. And when i start LS server it connecting 6661 and 6662, when i open the localhost:6662 showing error like attached.![Click image for larger version.
Name: phpadapter.jpg
Views: 1129
Size: 41.3 KB
ID: 224](https://forums.lightstreamer.com/attachment.php?s=b24af7015de275a617e42ef64330c107&attachmentid=224&d=1486127080&thumb=1)
-
February 3rd, 2017, 02:37 PM
#8
Hi rvkino,
after having exchanged some private message, it is now clear that TCP ports 6661 and 6662 are relative to the remote PHP Adapter Set.
Furthermore, it seems that you deployed the Adapter Set on a PHP runtime without the right pthreads module, so please follow instructions you can find here to fix your demo environment and get back to us.
Thansk and Regards,
Gianluca
Similar Threads
-
By cvikander in forum Adapter SDKs
Replies: 2
Last Post: April 28th, 2014, 02:23 PM
-
By ehsank in forum General
Replies: 1
Last Post: December 30th, 2013, 09:32 AM
-
By Digambar in forum Client SDKs
Replies: 3
Last Post: August 8th, 2013, 05:10 PM
-
Replies: 1
Last Post: August 5th, 2013, 10:09 AM
-
By venkatreddy in forum Client SDKs
Replies: 1
Last Post: September 8th, 2008, 10:06 AM
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 06:01 AM.
Bookmarks