Package javax.jbi.messaging

Examples of javax.jbi.messaging.MessageExchange.createMessage()


    public String send(String content, String operation, String mep) {
        ServiceMixClient client = null;
        try {
            client = registry.getContainer().getClientFactory().createClient();
            MessageExchange me = client.getExchangeFactory().createExchange(URI.create(mep));
            NormalizedMessage nm = me.createMessage();
            me.setMessage(nm, "in");
            nm.setContent(new StringSource(content));
            me.setEndpoint(endpoint);
            if (operation != null) {
                me.setOperation(QNameUtil.parse(operation));
View Full Code Here


        MessageExchangeFactory factory = channel.createExchangeFactory();
        MessageExchange me = factory.createExchange(exchange.getPattern());
        me.setInterfaceName(interfaceName);
        me.setService(service);
        me.setOperation(operation);
        NormalizedMessage nm = me.createMessage();
        me.setMessage(nm, "in");
        getMessageTransformer().transform(exchange, in, nm);
        channel.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            fail(exchange, me.getError());
View Full Code Here

    protected void testSerializeDeserialize(Source src) throws Exception {
        MessageExchange me = new InOnlyImpl("exchangeId");
        me.setOperation(new QName("uri", "op"));
        me.setProperty("myProp", "myValue");
        NormalizedMessage msg = me.createMessage();
        msg.setProperty("myMsgProp", "myMsgValue");
        msg.setContent(src);
        msg.addAttachment("myAttachment", new DataHandler(new StreamDataSource(new ByteArrayInputStream("hello".getBytes()))));
        me.setMessage(msg, "in");
        assertNotNull(((NormalizedMessageImpl) msg).getBody());
View Full Code Here

                exchange.setProperty(correlation, outExchange.getExchangeId());
                String processCorrelationId = (String)exchange.getProperty(JbiConstants.CORRELATION_ID);
                if (processCorrelationId != null) {
                    outExchange.setProperty(JbiConstants.CORRELATION_ID, processCorrelationId);
                }
                out = outExchange.createMessage();
            }
            boolean txSync = exchange.isTransacted() && Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC));
            copyPropertiesAndAttachments(exchange, in, out);
            if (transform(exchange, in, out)) {
                if (isInAndOut(exchange)) {
View Full Code Here

            if (endpoint != null) {
                me.setEndpoint(endpoint);
            }

            NormalizedMessage nmessage = me.createMessage();
            JbiUtils.populateNormalizedMessage(message, nmessage);
            me.setMessage(nmessage, IN);
            if(synchronous) {
                //todo timeout
                getContext().getDeliveryChannel().sendSync(me);
View Full Code Here

      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(portType));
      me.setOperation(new QName(operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
      channel.send(me);
    } catch (Exception e) {
      throw new EngineRuntimeException(e);
View Full Code Here

      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(namespace, portType));
      me.setOperation(new QName(namespace, operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
      channel.send(me);
    } catch (Exception e) {
      throw new EngineRuntimeException(e);
View Full Code Here

      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(portType));
      me.setOperation(new QName(operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
      channel.sendSync(me);
      NormalizedMessage out = me.getMessage("out");
      DocumentResult result = new DocumentResult();
View Full Code Here

      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(namespace, portType));
      me.setOperation(new QName(namespace, operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
      channel.sendSync(me);
      NormalizedMessage out = me.getMessage("out");
      DocumentResult result = new DocumentResult();
View Full Code Here

                xchng = factory.createRobustInOnlyExchange();
            } else {
                xchng = factory.createInOutExchange();
            }

            NormalizedMessage inMsg = xchng.createMessage();
            LOG.info(new org.apache.cxf.common.i18n.Message("EXCHANGE.ENDPOINT", LOG).toString()
                     + xchng.getEndpoint());
            if (inMsg != null) {
                LOG.info("setup message contents on " + inMsg);
                inMsg.setContent(getMessageContent(message));
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.