Examples of CarbonEventingMessageReceiver


Examples of org.wso2.carbon.event.broker.receivers.CarbonEventingMessageReceiver

                                        EventBrokerService brokerService, int tenantId)
            throws EventBrokerException {
        if (payload == null) {
            throw new EventBrokerException("Unable to generate event. No payload was given.");
        }
        CarbonEventingMessageReceiver dummyReceiver = new CarbonEventingMessageReceiver();
        if (brokerService != null) {
            dummyReceiver.setBrokerService(brokerService);
        }
        MessageContext mc = createMessageContext(payload, topic, tenantId);
        try {
            dummyReceiver.processMessage(mc);
        } catch (Exception e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException) e;
            }
            throw new EventBrokerException("Unable to generate event.", e);
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.receivers.CarbonEventingMessageReceiver

                                        EventBrokerService brokerService, int tenantId)
            throws EventBrokerException {
        if (payload == null) {
            throw new EventBrokerException("Unable to generate event. No payload was given.");
        }
        CarbonEventingMessageReceiver dummyReceiver = new CarbonEventingMessageReceiver();
        if (brokerService != null) {
            dummyReceiver.setBrokerService(brokerService);
        }
        MessageContext mc = new MessageContext();
        SuperTenantCarbonContext.getCurrentContext(mc).setTenantId(tenantId);
        SOAPFactory soapFactory = new SOAP12Factory();
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(payload);
        if (topic != null) {
            envelope.getHeader().addChild(topic);
        }
        try {
            mc.setEnvelope(envelope);
            dummyReceiver.processMessage(mc);
        } catch (Exception e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            }
            throw new EventBrokerException("Unable to generate event.", 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.