Examples of createTopic()


Examples of javax.jms.TopicSession.createTopic()

            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send new message matching the topic, checking message count
            TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = session.createTopic(TOPIC_NAME);
            TopicPublisher publisher = session.createPublisher(topic);

            publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
            session.commit();
            assertEquals("DurableSubscription backing queue should now have 2 messages on it",
View Full Code Here

Examples of javax.jms.TopicSession.createTopic()

            queueSession.close();

            TopicSession topicSession = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            AMQTopic topic = (AMQTopic) topicSession.createTopic("silly.topic");

            assertEquals(topic.getExchangeName().toString(), "test.topic");

            AMQTopic tempTopic = (AMQTopic) topicSession.createTemporaryTopic();
View Full Code Here

Examples of javax.jms.TopicSession.createTopic()

                                      String topic,
                                      String selector,
                                      JMSListener listener) throws JMSException {
    TopicSession session = ((TopicConnection)connection).
            createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic jmsTopic = session.createTopic(topic);
    MessageConsumer consumer = session.createConsumer(jmsTopic, selector, true);
    consumer.setMessageListener(listener);
  }

  private void initializeQueue(Connection connection,
View Full Code Here

Examples of javax.jms.XASession.createTopic()

            when(mockXASession.createConsumer((Destination) anyObject(), anyString())).thenReturn(messageConsumer);
            when(mockXASession.createConsumer((Destination) anyObject(), anyString(), anyBoolean())).thenReturn(messageConsumer);
            Queue queue = mock(Queue.class);
            when(mockXASession.createQueue(anyString())).thenReturn(queue);
            Topic topic = mock(Topic.class);
            when(mockXASession.createTopic(anyString())).thenReturn(topic);
            MockXAResource mockXAResource = new MockXAResource(null);
          when(mockXASession.getXAResource()).thenReturn(mockXAResource);         
            Answer<Session> sessionAnswer = new Answer<Session>() {
            public Session answer(InvocationOnMock invocation) throws Throwable {
              Session session = mock(Session.class);
View Full Code Here

Examples of org.apache.activemq.ActiveMQSession.createTopic()

            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, uri);
            ActiveMQConnection connection = (ActiveMQConnection)connectionFactory.createConnection();
            connection.start();

            ActiveMQSession session = (ActiveMQSession)connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
            Destination destination = session.createTopic("topic2");
            MessageProducer producer = session.createProducer(destination);
            producer.setDeliveryMode(DeliveryMode.PERSISTENT);
            for(int i=0;i<100;i++){
                TextMessage om=session.createTextMessage("hello from producer");
                producer.send(om);
View Full Code Here

Examples of org.hornetq.api.jms.management.JMSServerControl.createTopic()

      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
      checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));

      JMSServerControl control = createManagementControl();
      control.createTopic(topicName, topicJNDIBinding);

      Object o = UnitTestCase.checkBinding(context, bindings[0]);
      Assert.assertTrue(o instanceof Topic);
      Topic topic = (Topic)o;
      Assert.assertEquals(topicName, topic.getTopicName());
View Full Code Here

Examples of org.hornetq.api.jms.management.JMSServerControl.createTopic()

      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
      checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));

      JMSServerControl control = createManagementControl();
      control.createTopic(topicName, topicJNDIBinding);

      checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
      Topic topic = (Topic)context.lookup(topicJNDIBinding);
      assertNotNull(topic);
      HornetQConnectionFactory cf = new HornetQConnectionFactory(false,
View Full Code Here

Examples of org.hornetq.api.jms.management.JMSServerControl.createTopic()

      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
      checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));

      JMSServerControl control = createManagementControl();
      control.createTopic(topicName, topicJNDIBinding);

      checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
      Topic topic = (Topic)context.lookup(topicJNDIBinding);
      assertNotNull(topic);
      HornetQConnectionFactory cf = new HornetQConnectionFactory(false,
View Full Code Here

Examples of org.hornetq.api.jms.management.JMSServerControl.createTopic()

      String topicName = RandomUtil.randomString();

      JMSServerControl control = createManagementControl();
      Assert.assertEquals(0, control.getTopicNames().length);

      control.createTopic(topicName, topicJNDIBinding);

      String[] names = control.getTopicNames();
      Assert.assertEquals(1, names.length);
      Assert.assertEquals(topicName, names[0]);
View Full Code Here

Examples of org.hornetq.jms.server.JMSServerManager.createTopic()

    public synchronized void start(StartContext context) throws StartException {
        final JMSServerManager jmsManager = jmsServer.getValue();
        try {
            MockContext.pushBindingTrap();
            try {
                jmsManager.createTopic(false, name, jndi);
            } finally {
                final ServiceTarget target = context.getChildTarget();
                final Map<String, Object> bindings = MockContext.popTrappedBindings();
                for(Map.Entry<String, Object> binding : bindings.entrySet()) {
                    final BinderService binderService = new BinderService(binding.getKey());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.