Package com.streamreduce.client.outbound

Examples of com.streamreduce.client.outbound.OutboundClient


            String dtoAsString = exchange.getIn().getBody(String.class);
            OutboundConfigurationWithPayloadDTO dto = objectMapper.readValue(dtoAsString,
                    OutboundConfigurationWithPayloadDTO.class);
            OutboundConfiguration outboundConfiguration =
                    createOutboundConfigurationFromDto(dto.getOutboundConfiguration());
            OutboundClient outboundClient =
                    outboundClientFactory.createOutboundClientForOutboundConfiguration(outboundConfiguration);

            if (dto.getDataType() == OutboundDataType.RAW) {
                outboundClient.putRawMessage(JSONObject.fromObject(dto.getPayload()));
            } else if (dto.getDataType() == OutboundDataType.PROCESSED) {
                SobaMessageResponseDTO responseDTO =
                        objectMapper.readValue(dto.getPayload(), SobaMessageResponseDTO.class);
                outboundClient.putProcessedMessage(responseDTO);
            } else if (dto.getDataType() == OutboundDataType.INSIGHT) {
                SobaMessageResponseDTO responseDTO =
                        objectMapper.readValue(dto.getPayload(), SobaMessageResponseDTO.class);
                outboundClient.putInsightMessage(responseDTO);
            } else {
                throw new OutboundStorageException("The received OutboundConfigurationWithPayloadDTO does not " +
                        "specify a valid dataType.  Was " + dto.getDataType() +
                        " but was expecting one of [RAW, PROCESSED, or Insight]");
            }
View Full Code Here

TOP

Related Classes of com.streamreduce.client.outbound.OutboundClient

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.