use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class EmbeddedActiveMq method applyCfg.
private StandardJndiImplementation applyCfg(StandardJndiImplementation jndi, boolean useJndiOnly, String queueName, String topicName) {
jndi.getJndiParams().addKeyValuePair(new KeyValuePair(Context.PROVIDER_URL, DEF_URL_PREFIX + port));
jndi.getJndiParams().addKeyValuePair(new KeyValuePair(Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getName()));
jndi.getJndiParams().addKeyValuePair(new KeyValuePair("connectionFactoryNames", "connectionFactory, queueConnectionFactory, topicConnectionFactory"));
jndi.getJndiParams().addKeyValuePair(new KeyValuePair("queue." + queueName, queueName));
jndi.getJndiParams().addKeyValuePair(new KeyValuePair("topic." + topicName, topicName));
if (useJndiOnly) {
jndi.setUseJndiForQueues(true);
jndi.setUseJndiForTopics(true);
}
return jndi;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class AdvancedActiveMqImplementationTest method createClient53Properties.
private static KeyValuePairSet createClient53Properties() {
KeyValuePairSet props = new KeyValuePairSet();
props.addKeyValuePair(new KeyValuePair("AlwaysSyncSend", FALSE));
props.addKeyValuePair(new KeyValuePair("CloseTimeout", "10"));
props.addKeyValuePair(new KeyValuePair("DisableTimeStampsByDefault", TRUE));
props.addKeyValuePair(new KeyValuePair("DispatchAsync", TRUE));
props.addKeyValuePair(new KeyValuePair("NestedMapAndListEnabled", TRUE));
props.addKeyValuePair(new KeyValuePair("OptimizeAcknowledge", TRUE));
props.addKeyValuePair(new KeyValuePair("ProducerWindowSize", "100"));
props.addKeyValuePair(new KeyValuePair("SendTimeout", "99"));
props.addKeyValuePair(new KeyValuePair("AlwaysSessionAsync", TRUE));
props.addKeyValuePair(new KeyValuePair("ClientID", "flintstone"));
props.addKeyValuePair(new KeyValuePair("ClientIDPrefix", "fred"));
props.addKeyValuePair(new KeyValuePair("CopyMessageOnSend", TRUE));
props.addKeyValuePair(new KeyValuePair("ExclusiveConsumer", TRUE));
props.addKeyValuePair(new KeyValuePair("ObjectMessageSerializationDeferred", TRUE));
props.addKeyValuePair(new KeyValuePair("ObjectMessageSerializationDefered", TRUE));
props.addKeyValuePair(new KeyValuePair("OptimizedMessageDispatch", TRUE));
props.addKeyValuePair(new KeyValuePair("SendAcksAsync", TRUE));
props.addKeyValuePair(new KeyValuePair("UseCompression", TRUE));
props.addKeyValuePair(new KeyValuePair("UseRetroactiveConsumer", TRUE));
return props;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class AdvancedActiveMqImplementationTest method createClient59Properties.
private static KeyValuePairSet createClient59Properties() {
KeyValuePairSet props = new KeyValuePairSet();
// New 5.9 connection factory properties.
props.addKeyValuePair(new KeyValuePair("AuditDepth", "99"));
props.addKeyValuePair(new KeyValuePair("AuditMaximumProducerNumber", "99"));
props.addKeyValuePair(new KeyValuePair("ConnectionIDPrefix", "wilma"));
props.addKeyValuePair(new KeyValuePair("ConsumerFailoverRedeliveryWaitPeriod", "99"));
props.addKeyValuePair(new KeyValuePair("CheckForDuplicates", TRUE));
props.addKeyValuePair(new KeyValuePair("MaxThreadPoolSize", "99"));
props.addKeyValuePair(new KeyValuePair("MessagePrioritySupported", TRUE));
props.addKeyValuePair(new KeyValuePair("NonBlockingRedelivery", TRUE));
props.addKeyValuePair(new KeyValuePair("OptimizeAcknowledgeTimeOut", "99"));
props.addKeyValuePair(new KeyValuePair("OptimizedAckScheduledAckInterval", "99"));
props.addKeyValuePair(new KeyValuePair("StatsEnabled", TRUE));
props.addKeyValuePair(new KeyValuePair("TransactedIndividualAck", TRUE));
props.addKeyValuePair(new KeyValuePair("UseAsyncSend", TRUE));
props.addKeyValuePair(new KeyValuePair("UseDedicatedTaskRunner", TRUE));
props.addKeyValuePair(new KeyValuePair("WarnAboutUnstartedConnectionTimeout", "99"));
return props;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JndiPtpProducerCase method testProduceAndConsume_ExtraConfig.
@Test
public void testProduceAndConsume_ExtraConfig() throws Exception {
SimpleFactoryConfiguration sfc = new SimpleFactoryConfiguration();
KeyValuePairSet kvps = new KeyValuePairSet();
kvps.add(new KeyValuePair("ClientID", "testProduceAndConsume_ExtraConfig"));
kvps.add(new KeyValuePair("UseCompression", "true"));
sfc.setProperties(kvps);
String queueName = testName.getMethodName() + "_queue";
String topicName = testName.getMethodName() + "_topic";
StandardJndiImplementation recvVendorImp = createVendorImplementation();
StandardJndiImplementation sendVendorImp = createVendorImplementation();
sendVendorImp.setExtraFactoryConfiguration(sfc);
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJndiPtpConnection(recvVendorImp, false, queueName, topicName), new PtpConsumer().withQueue(queueName));
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJndiPtpConnection(sendVendorImp, false, queueName, topicName), new PtpProducer().withQueue((queueName)));
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms);
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class SimpleFactoryConfigurationTest method testApplyTopicConnectionFactory_NonDouble.
@Test
public void testApplyTopicConnectionFactory_NonDouble() throws Exception {
SimpleFactoryConfiguration extras = create(new KeyValuePair(SOME_DOUBLE_VALUE, "fred"));
DummyConnectionFactory mycf = new DummyConnectionFactory();
extras.applyConfiguration(mycf);
doBaseAssertions(mycf);
}
Aggregations