Examples of createProducer()


Examples of javax.jms.XASession.createProducer()

  
         //Send two messages in transaction 2
        
         res2.start(xid2, XAResource.TMNOFLAGS);
  
         MessageProducer prod2 = sess2.createProducer(queueTX);
  
         TextMessage tm3 = sess2.createTextMessage("tm3");
  
         prod2.send(tm3);
  
View Full Code Here

Examples of javax.jms.XATopicSession.createProducer()

    MessageProducer messageProducer = null;
   
    try {
      xaTopicConnection = xaTopicConnectionFactory.createXATopicConnection();
      xaTopicSession = xaTopicConnection.createXATopicSession();
      messageProducer = xaTopicSession.createProducer(topic);
      Message message = createMessage(xaTopicSession);
      messageProducer.send(message);

    } finally {
      try {
View Full Code Here

Examples of org.activiti.camel.ActivitiEndpoint.createProducer()

      public String answer(InvocationOnMock invocation) throws Throwable {
        invoked = true;
        return null;
      }
    }).when(activitiProducer).process((Exchange)anyObject());
    when(activitiEndpoint.createProducer()).thenReturn(activitiProducer);
    // and finally we add the mocked activiti component to the camel context
    context.addComponent("activiti", activitiComponent);
   
    return context;
  }
View Full Code Here

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

        ActiveMQConnectionFactory connFac = new ActiveMQConnectionFactory(url);
        Connection conn = connFac.createConnection();
        ActiveMQSession session = (ActiveMQSession)conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
        queue = session.createQueue("CheckAccounts");
        MessageProducer producer = session.createProducer(queue);
        MapMessage map = session.createMapMessage();

        for (int i = 0; i < 3; i++) {
            String accountNumber = "C00" + (i + 1);
            float balance = (float)(1000.0 + Math.random() * 200.0);
 
View Full Code Here

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

    public boolean canSendToEndpoint(String endpointUri) {
        try {
            Endpoint endpoint = context.getEndpoint(endpointUri);
            if (endpoint != null) {
                Producer producer = endpoint.createProducer();
                return producer != null;
            }
        } catch (Exception e) {
            // ignore
        }
View Full Code Here

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

    }

    public void testCheckServiceClassProcedure() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createProducer();
        } 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.http.HttpEndpoint.createProducer()

    @Test
    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        HttpEndpoint jettyEndpoint = context.getEndpoint("http://localhost:8080/myapp/myservice?httpClient.soTimeout=5555", HttpEndpoint.class);
        assertNotNull("Jetty endpoint should not be null ", jettyEndpoint);
        HttpProducer producer = (HttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http client parameter", 5555, producer.getHttpClient().getParams().getSoTimeout());

        // send and receive
        Object out = template.requestBody("http://localhost:9080/myapp/myservice", "Hello World");
        assertEquals("Bye World", context.getTypeConverter().convertTo(String.class, out));
View Full Code Here

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

       
        container.start();
       
        // Send a message to the JMS endpoint
        JmsEndpoint endpoint = (JmsEndpoint) container.getEndpoint("jms:test");       
        Producer<JmsExchange> producer = endpoint.createProducer();
        JmsExchange exchange = producer.createExchange();
        JmsMessage in = exchange.getIn();
        in.setBody("Hello");
        in.setHeader("cheese", 123);
        producer.process(exchange);
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.createProducer()

            LOG.info("Adviced endpoint [" + uri + "] with mock endpoint [" + key + "]");

            MockEndpoint mock = endpoint.getCamelContext().getEndpoint(key, MockEndpoint.class);
            Processor producer;
            try {
                producer = mock.createProducer();
            } catch (Exception e) {
                throw wrapRuntimeCamelException(e);
            }

            proxy.setDetour(producer);
View Full Code Here

Examples of org.apache.camel.impl.ProcessorEndpoint.createProducer()

        assertNotNull(pe);

        String uri = pe.getEndpointUri();
        assertEquals("bean:generated:MyFooBean", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
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.