Github user gemmellr commented on a diff in the pull request: https://github.com/apache/qpid-jms/pull/6#discussion_r115538757 --- Diff: qpid-jms-examples/src/main/java/org/apache/qpid/jms/example/Client.java --- @@ -0,0 +1,204 @@ + +package org.apache.qpid.jms.example; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.DeliveryMode; +import javax.jms.Destination; +import javax.jms.ExceptionListener; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Session; +import javax.jms.TemporaryQueue; +import javax.jms.TextMessage; +import javax.naming.Context; +import javax.naming.InitialContext; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Scanner; + +public class Client { + private static final int DELIVERY_MODE = DeliveryMode.NON_PERSISTENT; + public static void main(String[] args) throws Exception { + try { + // The configuration for the Qpid InitialContextFactory has been supplied in + // a jndi.properties file in the classpath, which results in it being picked + // up automatically by the InitialContext constructor. + Context context = new InitialContext(); + + ConnectionFactory factory = (ConnectionFactory) context.lookup("myFactoryLookup"); + Destination queue = (Destination) context.lookup("myQueueLookup"); + + Connection connection = factory.createConnection(System.getProperty("USER"), System.getProperty("PASSWORD")); + connection.setExceptionListener(new MyExceptionListener()); + connection.start(); + + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + --- End diff -- This line and most of the other 'empty' lines below actually have leading whitespace that should be removed. The 'git diff' command can be configured to show this whitespace if it isnt already, as can most IDE's (which can also typically format the code and remove them, either on request or automatically).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org