Results 1 to 8 of 8
  1. #1
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121

    Question 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.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  3. #3
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    So can i call the php page within javaadapter instead of writing login to create user rates inside the java file.

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  5. #5
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    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.
    Click image for larger version. 

Name:	phperror.jpg 
Views:	908 
Size:	49.8 KB 
ID:	223

  6. #6
    Power Member
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    161
    Hi rvkvino,

    the screenshots you uploaded are not very clear, could you please provide us with larger images?

    Thanks and Regards,
    Gianluca

  7. #7
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    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:	967 
Size:	41.3 KB 
ID:	224Click image for larger version. 

Name:	lsserver.jpg 
Views:	944 
Size:	47.8 KB 
ID:	225

  8. #8
    Power Member
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    161
    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

  1. Replies: 2
    Last Post: April 28th, 2014, 03:23 PM
  2. Replies: 1
    Last Post: December 30th, 2013, 10:32 AM
  3. Java Clent: How to pass headers (custom app info)
    By Digambar in forum Client SDKs
    Replies: 3
    Last Post: August 8th, 2013, 06:10 PM
  4. How to add LS to an existing website ?
    By JanA in forum General
    Replies: 1
    Last Post: August 5th, 2013, 11:09 AM
  5. Reg:Running DOT Net Application using lightstremer
    By venkatreddy in forum Client SDKs
    Replies: 1
    Last Post: September 8th, 2008, 11:06 AM

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 04:40 PM.