Package org.jboss.soa.esb.client

Examples of org.jboss.soa.esb.client.ServiceInvoker.deliverAsync()


        assertNull("message context", message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("securityContext", SecurityContext.getSecurityContext()) ;
       
        mockCourier.reset();
        si.deliverAsync(message) ;
       
        assertNotSame("messages", message, mockCourier.message) ;
        assertNull("message context", message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("securityContext", SecurityContext.getSecurityContext()) ;
View Full Code Here


        final byte[] authenticationRequest = new byte[0] ;
        AuthenticationRequestImpl.setEncryptedAuthRequest(authenticationRequest) ;
       
        assertNotNull("authenticationRequest", AuthenticationRequestImpl.getEncryptedAuthRequest()) ;
       
        si.deliverAsync(message) ;
       
        assertNotSame("messages", message, mockCourier.message) ;
        assertNull("message context", message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("authenticationRequest", AuthenticationRequestImpl.getEncryptedAuthRequest()) ;
View Full Code Here

        assertNull("message context", message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("authenticationRequest", AuthenticationRequestImpl.getEncryptedAuthRequest()) ;
       
        mockCourier.reset();
        si.deliverAsync(message) ;
       
        assertNotSame("messages", message, mockCourier.message) ;
        assertNull("message context", message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.AUTH_REQUEST)) ;
        assertNotNull("authenticationRequest", AuthenticationRequestImpl.getEncryptedAuthRequest()) ;
View Full Code Here

        // Set up fault routing...
        esbMessage.getHeader().getCall().setFaultTo(new LogicalEPR("ESBServiceSample", "FaultService"));

        try {
            invoker.deliverAsync(esbMessage);
        }catch(Exception ex) {
           ex.printStackTrace();
        }
        System.exit(0);
    }
View Full Code Here

      requestMessage.getBody().add(message);

      // Deliver the request message synchronously - timeout after 20
      // seconds...
      deliveryAdapter.deliverAsync(requestMessage);
   }
  
   public static void main(String args[]) throws Exception
   {
      SendEsbMessage sm = new SendEsbMessage();
View Full Code Here

            for (URI key : messageMap.keySet()) {
                ms.removeMessage(key, MessageStore.CLASSIFICATION_RDLVR);
            }
            Service noneExistingService = new Service("none-exising-category", "none-existing-service-name");
            ServiceInvoker si = new ServiceInvoker(noneExistingService);
            si.deliverAsync(message);
          
            //Adding this control code to show where the message now is.
            Map<URI, Message> rdlvrMessageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
            while (rdlvrMessageMap.size() == 0) { //we may have to wait for the DLQService to act.
                logger.info("...Waiting for the DLQ Service to act.");
View Full Code Here

                message.getHeader().getCall().setFrom(new LogicalEPR("A", "B"));
                Message faultMessage = Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, exception);

                // Should not get a MessageDeliverException...
                invoker.deliverAsync(faultMessage);

                // Mock action should have received faultMessage...
                waitForMockSet(faultMessage);
                assertTrue("Message equality", checkMessageEquality(faultMessage, MockAction.message));
            }
View Full Code Here

                    ResponseAction.responseMessage = MessageFactory.getInstance().getMessage();

                    request.getBody().add("Hello");

                    // Need to deliver async here because we're in a transaction (mock transaction)...
                    invoker.deliverAsync(request);
                    ResponseAction.waitForMessage(10000);
                } finally {
                    TransactionStrategy.setTransactionStrategy(new TransactionStrategy.NullTransactionStrategy());
                }
View Full Code Here

                    ResponseAction.responseMessage = MessageFactory.getInstance().getMessage();

                    request.getBody().add("Hello");

                    // Need to deliver async here because we're in a transaction (mock transaction)...
                    invoker.deliverAsync(request);
                    ResponseAction.waitForMessage(10000);
                } finally {
                    TransactionStrategy.setTransactionStrategy(new TransactionStrategy.NullTransactionStrategy());
                }
View Full Code Here

                //if exceeds the maxcount then update the classification to DLQ.
                Service to = (Service) message.getProperties().getProperty(ServiceInvoker.DELIVER_TO);
                try {
                    ServiceInvoker si = new ServiceInvoker(to.getCategory(), to.getName());
                    message.getProperties().setProperty(RedeliverStore.IS_REDELIVERY, true);
                    si.deliverAsync(message);
                    isDelivered=true;
                } catch (MessageDeliverException e) {
                    logger.debug(e.getMessage(), e);
                }
               
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.