Search in sources :

Example 11 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Example 12 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 13 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 14 with KeyValuePair

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);
}
Also used : PtpConsumer(com.adaptris.core.jms.PtpConsumer) KeyValuePair(com.adaptris.util.KeyValuePair) StandardJndiImplementation(com.adaptris.core.jms.jndi.StandardJndiImplementation) SimpleFactoryConfiguration(com.adaptris.core.jms.jndi.SimpleFactoryConfiguration) PtpProducer(com.adaptris.core.jms.PtpProducer) KeyValuePairSet(com.adaptris.util.KeyValuePairSet) StandaloneConsumer(com.adaptris.core.StandaloneConsumer) MockMessageListener(com.adaptris.core.stubs.MockMessageListener) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Example 15 with KeyValuePair

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);
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) Test(org.junit.Test)

Aggregations

KeyValuePair (com.adaptris.util.KeyValuePair)143 Test (org.junit.Test)79 KeyValuePairSet (com.adaptris.util.KeyValuePairSet)55 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)26 KeyValuePairList (com.adaptris.util.KeyValuePairList)12 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)11 StandaloneProducer (com.adaptris.core.StandaloneProducer)10 Channel (com.adaptris.core.Channel)9 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)9 TimeInterval (com.adaptris.util.TimeInterval)9 ServiceException (com.adaptris.core.ServiceException)7 JmsConnection (com.adaptris.core.jms.JmsConnection)6 ArrayList (java.util.ArrayList)6 CoreException (com.adaptris.core.CoreException)5 StandardWorkflow (com.adaptris.core.StandardWorkflow)5 PasProducer (com.adaptris.core.jms.PasProducer)5 MetadataCollection (com.adaptris.core.MetadataCollection)4 MetadataElement (com.adaptris.core.MetadataElement)4 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)4 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)3