Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Initial doc - before review

...

Code Block
java
java
borderStylesolid
titleConsignmentSender.java

Context ctx = new InitialContext(env);
			
QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(propLoader.getValue(CONNECTION_FACTORY_NAMES));
			
conn = factory.createQueueConnection();
			
Queue myQueue = (Queue) ctx.lookup(propLoader.getValue(QUEUE_NAME));
			
session = conn.createQueueSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);

producer = session.createProducer(myQueue);

conn.start();
			
consignmentMessage = session.createTextMessage();
			
consignmentMessage.setText(content);
			
producer.send(consignmentMessage);
			
System.out.println("Consignment Sent !!!"); 

...