use of com.adaptris.core.jms.JmsConnection in project interlok by adaptris.
the class BlobMessageTranslatorTest method testMoveMetadataJmsMessageToAdaptrisMessage.
@Test
public void testMoveMetadataJmsMessageToAdaptrisMessage() throws Exception {
MessageTypeTranslatorImp trans = new BlobMessageTranslator();
JmsConnection conn = null;
try {
conn = activeMqBroker.getJmsConnection(new BasicActiveMqImplementation());
start(conn);
Session session = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Message jmsMsg = createMessage(session);
addProperties(jmsMsg);
trans.registerSession(session);
trans.registerMessageFactory(new DefaultMessageFactory());
start(trans);
AdaptrisMessage msg = trans.translate(jmsMsg);
assertMetadata(msg);
} finally {
stop(trans);
stop(conn);
}
}
use of com.adaptris.core.jms.JmsConnection in project interlok by adaptris.
the class EmbeddedActiveMq method getJndiPtpConnection.
public JmsConnection getJndiPtpConnection(StandardJndiImplementation jv, boolean useJndiOnly, String queueName, String topicName) {
JmsConnection result = new JmsConnection();
StandardJndiImplementation jndi = applyCfg(jv, useJndiOnly, queueName, topicName);
jndi.setJndiName("queueConnectionFactory");
result.setVendorImplementation(jndi);
result.setClientId(createSafeUniqueId(jndi));
result.setConnectionRetryInterval(new TimeInterval(3L, TimeUnit.SECONDS));
result.setConnectionAttempts(1);
return result;
}
use of com.adaptris.core.jms.JmsConnection in project interlok by adaptris.
the class EmbeddedActiveMq method getJndiPasConnection.
public JmsConnection getJndiPasConnection(StandardJndiImplementation jv, boolean useJndiOnly, String queueName, String topicName) {
JmsConnection result = new JmsConnection();
StandardJndiImplementation jndi = applyCfg(jv, useJndiOnly, queueName, topicName);
jndi.setJndiName("topicConnectionFactory");
result.setVendorImplementation(jndi);
result.setClientId(createSafeUniqueId(jndi));
result.setConnectionRetryInterval(new TimeInterval(3L, TimeUnit.SECONDS));
result.setConnectionAttempts(1);
return result;
}
use of com.adaptris.core.jms.JmsConnection in project interlok by adaptris.
the class EmbeddedArtemis method getJmsConnection.
public JmsConnection getJmsConnection() {
StandardJndiImplementation standardJndiImplementation = new StandardJndiImplementation("ConnectionFactory");
standardJndiImplementation.getJndiParams().addKeyValuePair(new KeyValuePair("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"));
standardJndiImplementation.getJndiParams().addKeyValuePair(new KeyValuePair("java.naming.provider.url", "vm:/1"));
return applyCfg(new JmsConnection(), standardJndiImplementation, false);
}
use of com.adaptris.core.jms.JmsConnection in project interlok by adaptris.
the class BasicActiveMqConsumerTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
JmsConnection connection = new JmsConnection();
PtpConsumer producer = new PtpConsumer();
producer.setQueue("destination");
UrlVendorImplementation vendorImpl = createImpl();
vendorImpl.setBrokerUrl(BasicActiveMqImplementationTest.PRIMARY);
connection.setUserName("BrokerUsername");
connection.setPassword("BrokerPassword");
connection.setVendorImplementation(vendorImpl);
StandaloneConsumer result = new StandaloneConsumer();
result.setConnection(connection);
result.setConsumer(producer);
return result;
}
Aggregations