Package javax.jbi.messaging

Examples of javax.jbi.messaging.NormalizedMessage


    public void testSendingToStaticEndpoint() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOnly me = client.createInOnlyExchange();
        me.setService(new QName("urn:test", "service"));
        NormalizedMessage message = me.getInMessage();

        message.setProperty("name", "cheese");
        message.setContent(new StringSource("<hello>world</hello>"));

        client.sendSync(me);
        assertExchangeWorked(me);
    }
View Full Code Here


                    q = (LoanQuote) iter.next();
                    if (best == null || q.rate.doubleValue() < best.rate.doubleValue()) {
                        best = q;
                    }
                }
                NormalizedMessage response = ag.request.createMessage();
                response.setProperty(Constants.PROPERTY_RATE, best.rate);
                response.setProperty(Constants.PROPERTY_BANK, best.bank);
                ag.request.setMessage(response, "out");
                send(ag.request);
                aggregations.remove(id);
            }
        }
View Full Code Here

        QName[] recipients = (QName[]) getOutProperty(exchange, Constants.PROPERTY_RECIPIENTS);
        ag.numbers = recipients.length;
        for (int i = 0; i < recipients.length; i++) {
            InOut inout = createInOutExchange(recipients[i], null, null);
            inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
            NormalizedMessage msg = inout.createMessage();
            msg.setProperty(Constants.PROPERTY_SSN, ag.ssn);
            msg.setProperty(Constants.PROPERTY_AMOUNT, ag.amount);
            msg.setProperty(Constants.PROPERTY_DURATION, ag.duration);
            msg.setProperty(Constants.PROPERTY_SCORE, ag.score);
            msg.setProperty(Constants.PROPERTY_HISTORYLENGTH, ag.hlength);
            inout.setInMessage(msg);
            send(inout);
        }
        done(exchange);
    }
View Full Code Here

        ag.score  = (Integer) getOutProperty(exchange, Constants.PROPERTY_SCORE);
        ag.hlength = (Integer) getOutProperty(exchange, Constants.PROPERTY_HISTORYLENGTH);
        // Send to lender gateway
        InOut inout = createInOutExchange(new QName(Constants.LOANBROKER_NS, Constants.LENDERGATEWAY_SERVICE), null, null);
        inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
        NormalizedMessage msg = inout.createMessage();
        msg.setProperty(Constants.PROPERTY_SCORE, ag.score);
        msg.setProperty(Constants.PROPERTY_HISTORYLENGTH, ag.hlength);
        msg.setProperty(Constants.PROPERTY_AMOUNT, ag.amount);
        inout.setInMessage(msg);
        send(inout);
        done(exchange);
    }
View Full Code Here

            ag.duration = (Integer) getInProperty(exchange, Constants.PROPERTY_DURATION);
            aggregations.put(id, ag);
           
            InOut inout = createInOutExchange(new QName(Constants.LOANBROKER_NS, Constants.CREDITAGENCY_SERVICE), null, null);
            inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
            NormalizedMessage msg = inout.createMessage();
            msg.setProperty(Constants.PROPERTY_SSN, ag.ssn);
            inout.setInMessage(msg);
            send(inout);
        }
    }
View Full Code Here

                        ctx.getInMessage().addPrincipal(request.getUserPrincipal());
                    }
                }
                request.setAttribute(Context.class.getName(), ctx);
                exchange = soapHelper.onReceive(ctx);
                NormalizedMessage inMessage = exchange.getMessage("in");
                if (getConfiguration().isWantHeadersFromHttpIntoExchange()) {
                    inMessage.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(request));
                }
                locks.put(exchange.getExchangeId(), cont);
                request.setAttribute(MessageExchange.class.getName(), exchange.getExchangeId());
                synchronized (cont) {
                    channel.send(exchange);
View Full Code Here

            response.setStatus(HttpServletResponse.SC_ACCEPTED);
        }
    }

    private void processResponse(MessageExchange exchange, HttpServletRequest request, HttpServletResponse response) throws Exception {
        NormalizedMessage outMsg = exchange.getMessage("out");
        if (outMsg != null) {
            Context ctx = (Context) request.getAttribute(Context.class.getName());
            SoapMessage out = soapHelper.onReply(ctx, outMsg);
            SoapWriter writer = soapHelper.getSoapMarshaler().createWriter(out);
            response.setContentType(writer.getContentType());
View Full Code Here

        Document document = combineToDOMDocument(exchange.getMessage("in"), enricherTargetME.getMessage("out"));

        done(enricherTargetME);

        MessageExchange outExchange = getExchangeFactory().createInOnlyExchange();
        NormalizedMessage out = outExchange.createMessage();
        target.configureTarget(outExchange, getContext());
        out.setContent(new DOMSource(document));

        outExchange.setMessage(out, "in");

        sendSync(outExchange);
        done(exchange);
View Full Code Here

                try {
                    Fault fault = exchange.getFault();
                    if (fault != null) {
                        sendFault(exchange, fault, request, response);
                    } else {
                        NormalizedMessage outMsg = exchange.getMessage("out");
                        if (outMsg != null) {
                            sendOut(exchange, outMsg, request, response);
                        }
                    }
                    exchange.setStatus(ExchangeStatus.DONE);
View Full Code Here

        processMessage(exchange);
        done(exchange);
    }

    private void processMessage(MessageExchange sourceExchange) throws MessagingException, InterruptedException {
        NormalizedMessage source = sourceExchange.getMessage("in");
        NormalizedMessage copy = getMessageCopier().copy(source);
        MessageExchange targetExchange = createTargetExchange(copy, sourceExchange.getPattern());
        // add target exchange to resequencer (blocking if capacity is reached)
        reseq.put(targetExchange);
    }
View Full Code Here

TOP

Related Classes of javax.jbi.messaging.NormalizedMessage

Copyright © 2018 www.massapicom. 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.