Scala-ActiveMQ Producer-Consumer
Producer reads a log file and messages line by line to a topic as a text string and exits
Consumer reads from the topic by polling continuously
- JDK 1.8
- sbt
- Scala 2.13.6
- ActiveMQ
- Java 1.8
- Message Queue name: messageQueue
- Start ActiveMQ
-
ActiveMQ Scala Producer Application
-
ActiveMQ Scala Consumer Application
sbt clean
sbt run
Terminal 1: Start ActiveMQ
- .\bin\activemq start
Terminal 2: sbt run
options 1/ 2 for ActiveMQConsumer/ ActiveMQProducer
Choose option 1 . Consumer keeps polling the queue for any message
Terminal 3: sbt run
options 1/ 2 for ActiveMQConsumer/ ActiveMQProducer
Choose option 2. This sends a message to the queue.
Received message in Consumer Terminal 2 is printed in console
---