p.setTransacted(true);
connectionFactory = p.createConnectionFactory();
connection = p.createConnection(connectionFactory);
System.out.println("Created connection: " + connection);
session = p.createSession(connection);
System.out.println("Created session: " + session);
Destination destination = p.createDestination(session, getSubject() + "." + getName());
System.out.println("Created destination: " + destination + " of type: " + destination.getClass());
producer = p.createProducer(session, destination);
System.out.println("Created producer: " + producer);