Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
PoolingConnectionFactory myConnectionFactory = new PoolingConnectionFactory ();
myConnectionFactory.setClassName("bitronix.tm.resource.jms.JndiXAConnectionFactory");
myConnectionFactory.setUniqueName("swiftmq");
myConnectionFactory.setMaxPoolSize(5);
myConnectionFactory.setAllowLocalTransactions(true);
myConnectionFactory.getDriverProperties().setProperty("name", "QueueConnectionFactory@router1");
myConnectionFactory.getDriverProperties().setProperty("initialContextFactory", "com.swiftmq.jndi.InitialContextFactoryImpl");
myConnectionFactory.getDriverProperties().setProperty("providerUrl", "smqp://localhost:4001/timeout=10000");

Connection c = myConnectionFactory.createConnection();
 // create some session then send or receive some message
c.close();

myConnectionFactory.close();

...