Examples of createConsumer()


Examples of org.apache.camel.Endpoint.createConsumer()

        Endpoint endpoint = component.createEndpoint(getEndpointUri(settingsFile.getName(), null));
       
        final CountDownLatch latch = new CountDownLatch(1);
       
        Consumer consumer = endpoint.createConsumer(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                QuickfixjEventCategory eventCategory =
                    (QuickfixjEventCategory) exchange.getIn().getHeader(QuickfixjEndpoint.EVENT_CATEGORY_KEY);
                if (eventCategory == QuickfixjEventCategory.SessionCreated) {
View Full Code Here

Examples of org.apache.camel.component.cxf.CxfEndpoint.createConsumer()

    }

    public void testCheckServiceClassConsumer() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createConsumer(new NullProcessor());
        } catch (CamelException exception) {
            assertNotNull("Should get a CamelException here", exception);
            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsEndpoint.createConsumer()

        assertEquals("pubSubDomain", false, template.isPubSubDomain());
    }

    public void testListenerContainerUsesSpringConnectionFactory() throws Exception {
        JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:topic:test.foo");
        JmsConsumer consumer = endpoint.createConsumer(new Logger());

        AbstractMessageListenerContainer listenerContainer = consumer.getListenerContainer();
        assertIsInstanceOf(ActiveMQConnectionFactory.class, listenerContainer.getConnectionFactory());
        assertEquals("pubSubDomain", true, listenerContainer.isPubSubDomain());
View Full Code Here

Examples of org.apache.camel.component.seda.SedaEndpoint.createConsumer()

        // remove leading dash as we add that ourselves
        if (id.startsWith("-")) {
            id = id.substring(1);
        }
        SedaEndpoint seda = camelContext.getEndpoint("seda:" + verb + "-" + id, SedaEndpoint.class);
        return seda.createConsumer(processor);
    }

}
View Full Code Here

Examples of org.apache.camel.spi.RestConsumerFactory.createConsumer()

                factory = factories.iterator().next();
            }
        }

        if (factory != null) {
            Consumer consumer = factory.createConsumer(getCamelContext(), processor, getMethod(), getPath(), getUriTemplate(), getConsumes(), getProduces(), getParameters());
            configureConsumer(consumer);

            // if no explicit port/host configured, then use port from rest configuration
            String scheme = "http";
            String host = "";
View Full Code Here

Examples of org.apache.oozie.jms.ConnectionContext.createConsumer()

                "wf-app-name1", startDate, null);

        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe));
            wfEventListener.onWorkflowJobEvent(wfe);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertFalse(message.getText().contains("endTime"));
            WorkflowJobMessage wfStartMessage = JMSMessagingUtils.getEventMessage(message);
            assertEquals(WorkflowJob.Status.RUNNING, wfStartMessage.getStatus());
View Full Code Here

Examples of org.apache.qpid.client.AMQSession.createConsumer()

        FieldTable ft = new FieldTable();
        ft.setString("x-match", "any");
        ft.setString("F1000", "1");
        consumerSession.declareAndBind(queue, ft);
        MessageConsumer consumer = consumerSession.createConsumer(queue);
        // force synch to ensure the consumer has resulted in a bound queue
        // ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
        // This is the default now

        Connection con2 = (AMQConnection) getConnection("guest", "guest");
View Full Code Here

Examples of org.apache.qpid.jms.Session.createConsumer()

                new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q1"), new AMQShortString("Q1"),
                             false, true);
        Queue queue2 =
                new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q2"), new AMQShortString("Q2"),
                             false, true);
        MessageConsumer consumer = consumerSession.createConsumer(queue);
        MessageConsumer consumer2 = consumerSession.createConsumer(queue2);

        AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
        Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
        MessageProducer producer = producerSession.createProducer(queue);
View Full Code Here

Examples of org.codehaus.activemq.test.JmsResourceProvider.createConsumer()

        System.out.println("Created session: " + session);
        Destination destination = p.createDestination(session, getSubject() + "." + getName());
        System.out.println("Created destination: " + destination + " of type: " + destination.getClass());
        producer = p.createProducer(session, destination);
        System.out.println("Created producer: " + producer);
        consumer = p.createConsumer(session, destination);
        System.out.println("Created consumer: " + consumer);
        connection.start();
    }

    protected void tearDown() throws Exception {
View Full Code Here

Examples of org.gatein.wsrp.registration.mapping.ConsumersAndGroupsMapping.createConsumer()

      try
      {
         ChromatticSession session = persister.getSession();

         ConsumersAndGroupsMapping mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
         ConsumerMapping cm = mappings.createConsumer(consumerId);
         mappings.getConsumers().add(cm);
         cm.initFrom(consumer);
         consumer.setPersistentKey(cm.getPersistentKey());

         persister.save();
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.