Recently I faced some issue to configure JMS queue in Spring's application context. This queue is exposed on Sonic ESB and I have to connect to it using Apache Camel. First I wrote
a JMS Producer class which puts message on client's sonic JMS queue. It was something like this:
HashtableNow above JMS queue setup in applicationContext xml using Camel route.Here I am routing message to sonic queue through a seda queue.properties = new Hashtable (); properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.test.factory"); properties.put("com.domain", "DevelopmentDomain"); properties.put(Context.PROVIDER_URL, "tcp://10.00.0.00:0506"); properties.put(Context.SECURITY_PRINCIPAL, "aaa"); properties.put(Context.SECURITY_CREDENTIALS, "aaa"); javax.naming.Context context = new javax.naming.InitialContext(properties); ConnectionFactory factory = (ConnectionFactory) context.lookup("ImpactPocQueueConnectionFactory"); Connection connection = factory.createConnection(); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Destination queue = session.createQueue("test.producer");
com.test.factory DevelopmentDomain tcp://10.00.0.00:0506 aaa aaa