Lightstreamer JMS Extender - Stock-List Demo - Java (JMS) Service
This project contains the source code and all the resources needed to install the Stock-List Demo Service for Lightstreamer JMS Extender.
The Stock-List Demo Service is stand-alone Java application that acts as a service, sending simulated stock quotes to a JMS topic. It provides data for client-side Stock-List Demos for JMS Extender, such as the HTML Demo and the Node.js Demo.
Note that this service makes no use of the JMS Extender APIs: it works by using directly the JMS APIs. For simplicity, a single JMS topic is used for all stocks, while in a real scenario you would probably use a different JMS topic for each stock.
Check out the sources for further explanations.
If you want to install a version of this demo pointing to your local Lightstreamer JMS Extender, follow these steps:
Configure the JMS Broker
As prerequisite, this demo needs a JMS infrastructure to run. You can choose whatever JMS broker you prefer to be used for this example. We will show 3 examples using Apache ActiveMQ, Apache ActiveMQ Artemis, and TIBCO EMS:
There's no need to create topics or queues, because ActiveMQ supports dynamic configuration of destinations.
Apache ActiveMQ Artemis
There's no need to create topics or queues, because ActiveMQ Artemis supports dynamic configuration of destinations.
You should create a new topic. Open the
topics.conffile and append to it
NOTE: In the case of a different JMS broker, please follow the relative instructions on how to properly configure a topic. Furthermore, add an entry to the
dependencies section in the
build.gradle (read the
inline comments for more details).
Configure the Demo Service
To configure the demo service, follow these steps:
Edit the set of settings as per the configuration of the selected JMS broker in the
src/main/resources/service.conffile. If you want use a different broker, add the relative settings following the provided samples. All parameters are mandatory.
Check the logging configuration file
Build the Demo Service
To build the demo service, run Gradle as follows:
$ ./gradlew buildDemo -Pbroker=<JMS Broker>
broker property can be:
<JMS_BROKER>string you specified in the he
build.gradlein the case of different JMS broker.
buildDemo task will create a distribution of the project under the
build/install/stocklist-demo-service folder, from which you can start the service.
build/deploy folder will be populated with all the JMS broker-specific jar files to be deployed into your local JMS Extender installation. In addition,
feedmessage-X.Y.Z.jar will contains the
FeedMessage class required by the Extender to create any object sent or received by its clients.
Start the Demo Service
build/install/stocklist-demo-service directory, run the launch script to start sending simulated messages to the JMS broker:
bin/stocklist-demo-service.bat on Windows systems.
Set up Lightstreamer JMS Extender
The JMS Extender StockList Demo requires a Lightstreamer JMS Extender instance running. Please refer to Lightstreamer web site download page to find Lightstreamer JMS Extender download packages.
Now copy the jar files from
<JMS_EXTENDER_HOME>/jms_connectors/jms_connectors_conf.xmlfile, ensuring that the sample JMS connector configuration relative to the selected JMS broker is enabled. In particular, check that the
disabledparameter is set to
NOTE: Add a new JMS connector configuration in the case you want to use a differente JMS broker: see the inline comments for details.
Now you can test this demo running the Lightstreamer JMS Extender - Basic Stock-List Demo - HTML Client.
Clients Using This Service
- Lightstreamer JMS Extender - Basic Stock-List Demo - HTML Client
- Lightstreamer JMS Extender - Basic Stock-List Demo - Node.js Client
- Lightstreamer JMS Extender - Basic Stock-List Demo - Java SE Client
- Lightstreamer JMS Extender - Basic Stock-List Demo - Android Client
Lightstreamer Compatibility Notes
- Compatible with Lightstreamer JMS Extender since version 2.0.0 or newer.