Created
November 27, 2012 21:34
-
-
Save rboyd/4157220 to your computer and use it in GitHub Desktop.
consumer example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns consumer | |
(:import [javax.jms Connection Message MessageConsumer Queue Session MessageListener TextMessage]) | |
(:import [org.hornetq.api.core TransportConfiguration]) | |
(:import [java.util HashMap Map]) | |
(:import [org.hornetq.api.jms HornetQJMSClient JMSFactoryType]) | |
(:import [org.hornetq.jms.client HornetQConnectionFactory])) | |
(def props (java.util.HashMap. {"host" "somehost" "port" (Integer. 1234) "use-nio" true})) | |
(def transportConfig (TransportConfiguration. "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" props)) | |
(def hqFactory (HornetQJMSClient/createConnectionFactoryWithoutHA JMSFactoryType/CF ^"[Lorg.hornetq.api.core.TransportConfiguration;" (into-array [transportConfig]))) | |
(def queue (HornetQJMSClient/createQueue "SomeQueue")) | |
(def connection (.createConnection hqFactory)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment