Search in sources :

Example 6 with ActiveMQTopic

use of org.apache.activemq.artemis.jms.client.ActiveMQTopic in project pentaho-kettle by pentaho.

the class ActiveMQProvider method getDestination.

@Override
public Destination getDestination(JmsDelegate delegate, VariableSpace variableSpace) {
    checkNotNull(delegate.destinationName, getString(JmsConstants.PKG, "JmsWebsphereMQ.DestinationNameRequired"));
    String destName = variableSpace.environmentSubstitute(delegate.destinationName);
    return isQueue(delegate, variableSpace) ? new ActiveMQQueue(destName) : new ActiveMQTopic(destName);
}
Also used : ActiveMQTopic(org.apache.activemq.artemis.jms.client.ActiveMQTopic) ActiveMQQueue(org.apache.activemq.artemis.jms.client.ActiveMQQueue) BaseMessages.getString(org.pentaho.di.i18n.BaseMessages.getString)

Example 7 with ActiveMQTopic

use of org.apache.activemq.artemis.jms.client.ActiveMQTopic in project activemq-artemis by apache.

the class StringRefAddrReferenceTest method testActiveMQTopicFromPropertiesJNDI.

@Test(timeout = 10000)
public void testActiveMQTopicFromPropertiesJNDI() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(TYPE, ActiveMQTopic.class.getName());
    properties.setProperty(FACTORY, JNDIReferenceFactory.class.getName());
    String address = "foo.bar.topic";
    properties.setProperty("address", address);
    Reference reference = from(properties);
    ActiveMQTopic object = getObject(reference, ActiveMQTopic.class);
    assertEquals(address, object.getAddress());
}
Also used : ActiveMQTopic(org.apache.activemq.artemis.jms.client.ActiveMQTopic) Reference(javax.naming.Reference) JNDIReferenceFactory(org.apache.activemq.artemis.jndi.JNDIReferenceFactory) Properties(java.util.Properties) Test(org.junit.Test)

Example 8 with ActiveMQTopic

use of org.apache.activemq.artemis.jms.client.ActiveMQTopic in project activemq-artemis by apache.

the class ReferenceableTest method testReferenceTopic.

@Test
public void testReferenceTopic() throws Exception {
    Reference topicRef = ((Referenceable) ActiveMQServerTestCase.topic1).getReference();
    String factoryName = topicRef.getFactoryClassName();
    Class factoryClass = Class.forName(factoryName);
    ObjectFactory factory = (ObjectFactory) factoryClass.newInstance();
    Object instance = factory.getObjectInstance(topicRef, null, null, null);
    ProxyAssertSupport.assertTrue(instance instanceof ActiveMQDestination);
    ActiveMQTopic topic2 = (ActiveMQTopic) instance;
    ProxyAssertSupport.assertEquals(ActiveMQServerTestCase.topic1.getTopicName(), topic2.getTopicName());
    simpleSendReceive(cf, topic2);
}
Also used : ActiveMQTopic(org.apache.activemq.artemis.jms.client.ActiveMQTopic) Referenceable(javax.naming.Referenceable) ObjectFactory(javax.naming.spi.ObjectFactory) Reference(javax.naming.Reference) ActiveMQDestination(org.apache.activemq.artemis.jms.client.ActiveMQDestination) Test(org.junit.Test)

Aggregations

ActiveMQTopic (org.apache.activemq.artemis.jms.client.ActiveMQTopic)8 Test (org.junit.Test)3 Reference (javax.naming.Reference)2 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)2 ActiveMQQueue (org.apache.activemq.artemis.jms.client.ActiveMQQueue)2 BaseMessages.getString (org.pentaho.di.i18n.BaseMessages.getString)2 URI (java.net.URI)1 List (java.util.List)1 Properties (java.util.Properties)1 Connection (javax.jms.Connection)1 MessageConsumer (javax.jms.MessageConsumer)1 MessageProducer (javax.jms.MessageProducer)1 Session (javax.jms.Session)1 TextMessage (javax.jms.TextMessage)1 Referenceable (javax.naming.Referenceable)1 ObjectFactory (javax.naming.spi.ObjectFactory)1 Consumes (javax.ws.rs.Consumes)1 POST (javax.ws.rs.POST)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1