Search in sources :

Example 6 with KeyValuePairSet

use of com.adaptris.util.KeyValuePairSet in project interlok by adaptris.

the class JndiPtpProducerTest method createJndiVendorImpExample.

static JmsConnection createJndiVendorImpExample(StandardJndiImplementation jndi, JmsConnection c) {
    jndi.setJndiName("MyConnectionFactory");
    KeyValuePairSet kvps = jndi.getJndiParams();
    // jndi.getJndiParams().addKeyValuePair(
    // new KeyValuePair(Context.INITIAL_CONTEXT_FACTORY,
    // "com.sun.jndi.fscontext.RefFSContextFactory"));
    kvps.addKeyValuePair(new KeyValuePair(Context.SECURITY_PRINCIPAL, "Administrator"));
    kvps.addKeyValuePair(new KeyValuePair(Context.SECURITY_CREDENTIALS, "Administrator"));
    kvps.addKeyValuePair(new KeyValuePair("com.sonicsw.jndi.mfcontext.domain", "Domain1"));
    kvps.addKeyValuePair(new KeyValuePair(Context.INITIAL_CONTEXT_FACTORY, "com.sonicsw.jndi.mfcontext.MFContextFactory"));
    jndi.getJndiParams().addKeyValuePair(new KeyValuePair(Context.PROVIDER_URL, "tcp://localhost:2506"));
    c.setVendorImplementation(jndi);
    c.setClientId(null);
    c.setConnectionErrorHandler(new JmsConnectionErrorHandler());
    return c;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 7 with KeyValuePairSet

use of com.adaptris.util.KeyValuePairSet 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 8 with KeyValuePairSet

use of com.adaptris.util.KeyValuePairSet 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 9 with KeyValuePairSet

use of com.adaptris.util.KeyValuePairSet 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 10 with KeyValuePairSet

use of com.adaptris.util.KeyValuePairSet in project interlok by adaptris.

the class SimpleFactoryConfigurationTest method create.

protected static SimpleFactoryConfiguration create(KeyValuePair kvp) {
    SimpleFactoryConfiguration result = new SimpleFactoryConfiguration();
    KeyValuePairSet kvps = new KeyValuePairSet();
    kvps.add(kvp);
    result.setProperties(kvps);
    return result;
}
Also used : KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Aggregations

KeyValuePairSet (com.adaptris.util.KeyValuePairSet)62 KeyValuePair (com.adaptris.util.KeyValuePair)54 Test (org.junit.Test)30 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)5 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)5 TimeInterval (com.adaptris.util.TimeInterval)4 SimpleFactoryConfiguration (com.adaptris.core.jms.jndi.SimpleFactoryConfiguration)3 Connection (java.sql.Connection)3 ArrayList (java.util.ArrayList)3 CoreException (com.adaptris.core.CoreException)2 ServiceException (com.adaptris.core.ServiceException)2 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)2 StandaloneProducer (com.adaptris.core.StandaloneProducer)2 Execution (com.adaptris.core.common.Execution)2 MetadataDataInputParameter (com.adaptris.core.common.MetadataDataInputParameter)2 StringPayloadDataInputParameter (com.adaptris.core.common.StringPayloadDataInputParameter)2 JdbcConnection (com.adaptris.core.jdbc.JdbcConnection)2 JunitBootstrapProperties (com.adaptris.core.stubs.JunitBootstrapProperties)2 MockMessageListener (com.adaptris.core.stubs.MockMessageListener)2 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)2