Package org.jboss.soa.esb.couriers

Examples of org.jboss.soa.esb.couriers.TwoWayCourier.pickup()


    epr.setInputSuffix(".esbMessage");
    epr.setPostDelete(true);
    TwoWayCourier courier = CourierFactory.getPickupCourier(epr);

    Message message = null;
    while (null != (message = courier.pickup(100)))
      System.out.println(message.getHeader().getCall().getMessageID());
  }

  private final void deliver (String url) throws Exception
  {
View Full Code Here


    FileEpr fromEpr = new FileEpr(toEpr.getURI());
    fromEpr.setInputSuffix(TEST_SUFFIX);
    fromEpr.setPostSuffix(DONE_SUFFIX);
   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
    Message retrieved = pickUp.pickup(1000);
    Assert.assertFalse("Null message retrieved",null==retrieved);
   
    String back = new String((byte[]) retrieved.getBody().get());
    Assert.assertEquals(contents,back);
    _logger.info("Contents of retrieved msg equal original text <"+back+">");
View Full Code Here

   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);

    try
    {
        Message retrieved = pickUp.pickup(1000);
        _logger.info(retrieved);
        Assert.fail();
    }
    catch (FaultMessageException ex)
    {
View Full Code Here

    FileEpr fromEpr = new FileEpr(toEpr.getURI());
    fromEpr.setInputSuffix(TEST_SUFFIX);
    fromEpr.setPostSuffix(DONE_SUFFIX);
   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
    Message retrieved = pickUp.pickup(1000);
    Assert.assertFalse("Null message retrieved",null==retrieved);
   
    String back = new String((byte[]) retrieved.getBody().get());
    Assert.assertEquals(contents,back);
    _logger.info("Contents of retrieved msg equal original text <"+back+">");
View Full Code Here

    fromEpr.setInputSuffix(TEST_SUFFIX);
    // setting postdelete to true will delete input Message files, if they were picked up
    fromEpr.setPostDelete(true);
   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
    Message retrieved = pickUp.pickup(1000);
    Assert.assertFalse("Null message retrieved",null==retrieved);
   
    String back = new String((byte[]) retrieved.getBody().get());
    Assert.assertEquals(contents,back);
    _logger.info("Contents of retrieved msg equal original text <"+back+">");
View Full Code Here

    fromEpr.setErrorSuffix(ERROR_SUFFIX);
    // Don't delete - default is to delete files in error
    fromEpr.setErrorDelete(false);
   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
    Message retrieved = pickUp.pickup(1000);
    Assert.assertTrue("Null message retrieved",null==retrieved);
   
    theFile = new File(_tmpDir,uid+TEST_SUFFIX+ERROR_SUFFIX);
    Assert.assertTrue(theFile.exists());
    _logger.info("Message file properly renamed to "+theFile.toString());
View Full Code Here

    fromEpr.setPostSuffix(DONE_SUFFIX);
    fromEpr.setErrorSuffix(ERROR_SUFFIX);
    // Not using setErrorDelete(false) should delete files in error
   
    TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
    Message retrieved = pickUp.pickup(1000);
    Assert.assertTrue("Null message retrieved",null==retrieved);
   
    FileFilter ff = new FileFilter()
    { public boolean accept(File file)
      {return file.getName().startsWith(uid); }
View Full Code Here

                            // JBESB-1016 replyToEPR has to be non-null or we'd have dropped out by this point!

                            // do we need to do this for synchronous calls? Vagueries of Couriers?

                            courier.setReplyToEpr(replyToEPR);
                            final Message response = courier.pickup(timeout);
                            if (response == null) {
                                throw new ResponseTimeoutException("No response received within timeout period") ;
                            }
                            return response ;
                        } else {
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.