https://github.com/sullis/jms-testkit
in-memory JMS broker for unit testing (Scala, Java)
https://github.com/sullis/jms-testkit
activemq java jms scala scalatest
Last synced: 5 months ago
JSON representation
in-memory JMS broker for unit testing (Scala, Java)
- Host: GitHub
- URL: https://github.com/sullis/jms-testkit
- Owner: sullis
- License: apache-2.0
- Created: 2018-12-04T00:02:15.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-12-20T05:00:36.000Z (6 months ago)
- Last Synced: 2025-12-22T12:55:22.816Z (6 months ago)
- Topics: activemq, java, jms, scala, scalatest
- Language: Scala
- Homepage:
- Size: 349 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jms-testkit
in-memory JMS library
# Scala build.sbt
```
"io.github.sullis" %% "jms-testkit" % "1.0.4" % Test
```
# Scala code example
```
import jmstestkit.JmsQueue
val queue = JmsQueue()
queue.publishMessage("Portland")
queue.publishMessage("Seattle")
System.out.println("queueName: " + queue.queueName)
System.out.println("size: " + queue.size)
System.out.println("snapshot: " + queue.toSeq)
val connFactory = queue.createQueueConnectionFactory // javax.jms.QueueConnectionFactory
```
# Maven pom.xml
```
io.github.sullis
jms-testkit_2.12
1.0.4
test
```
# Java code example
```
import jmstestkit.JmsQueue;
import javax.jms.QueueConnectionFactory;
JmsQueue queue = JmsQueue.apply();
queue.publishMessage("Whistler");
queue.publishMessage("Blackcomb");
System.out.println("queueName: " + queue.queueName());
System.out.println("size: " + queue.size());
System.out.println("snapshot: " + queue.toJavaList());
QueueConnectionFactory connFactory = queue.createQueueConnectionFactory();
```
# Projects that use [jms-testkit]
- [fs2-jms](https://github.com/kiambogo/fs2-jms)
- [Alpakka](https://github.com/akka/alpakka/tree/master/jms/src)
# ActiveMQ Artemis
- [Embedding Apache ActiveMQ Artemis](https://activemq.apache.org/components/artemis/documentation/2.0.0/embedding-activemq.html)
# Related resources
- [http://activemq.apache.org/how-to-unit-test-jms-code.html]
- [https://stackoverflow.com/questions/2870431/unit-testing-with-jms-activemq]
- [https://stackoverflow.com/questions/14342430/are-there-any-mq-servers-that-can-run-embedded-in-a-java-process]
- [https://github.com/apache/activemq/blob/master/activemq-tooling/activemq-junit/src/main/java/org/apache/activemq/junit/EmbeddedActiveMQBroker.java]
- [https://github.com/apache/camel/blob/master/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/batch/EmbeddedActiveMQBroker.java]
- [https://github.com/apache/activemq-artemis/blob/master/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java]
- [https://github.com/jkorab/camel-jms-batch/blob/master/src/test/java/org/apache/camel/component/sjms/batch/EmbeddedActiveMQBroker.java]
- mockrunner-jms [http://mockrunner.github.io/mockrunner/examplesjms.html]
# Acknowledgements
This project uses [sbt-ci-release](https://github.com/sbt/sbt-ci-release)