-
October 31st, 2013, 09:58 AM
#1
Request/Reply RPC style communication using Light Streamer Websockets.
Hi,
We have a requirement to establish an RPC style communication between a client and a server using Websockets. The server is an online ordering solution which needs to submit orders to over 5000 point of sales systems (POS) all over the US.
We downloaded your software and did some POC, however we are unable to find out how we can do a synchronous request/reply between the server and the client. In our case the server needs to issue the following calls to the client (POS) and get a reply on the same thread synchronously
- Call the POS to get the customer's personal information
- Post the credit card data and the order data to the POS and get a confirmation on the same thread
Is it possible to do RPC style communication using your product?
Thanks in Advance
-
November 4th, 2013, 09:39 AM
#2
Hi,
I confirm there is no such direct way to do request/reply with Lightstreamer. You should use the sendMessage for the request and use a dedicated item to get asynchronous responses.
A trick could be used to obtain the request/reply infrastructure but we do not officially suggest to use it as it may create confusion in the error handling code. When you receive a message from a client you can handle it by throwing a CreditsException: the code and message of the exception are forwarded to the client and exposed by our API
Note that the same facilities are available on all the SDKs.
In the future, the sendMessage infrastructure will be extended to support custom messages on the OK responses (but not in the very short term).
see
http://www.lightstreamer.com/docs/cl...ml#sendMessage
http://www.lightstreamer.com/docs/cl...eListener.html
http://www.lightstreamer.com/docs/ad...a.lang.String)
http://www.lightstreamer.com/docs/ad...Exception.html
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 08:29 AM.
Bookmarks