use of com.amazonaws.services.sns.model.PublishRequest in project camel by apache.
the class SnsProducer method process.
public void process(Exchange exchange) throws Exception {
PublishRequest request = new PublishRequest();
request.setTopicArn(getConfiguration().getTopicArn());
request.setSubject(determineSubject(exchange));
request.setMessageStructure(determineMessageStructure(exchange));
request.setMessage(exchange.getIn().getBody(String.class));
request.setMessageAttributes(this.translateAttributes(exchange.getIn().getHeaders(), exchange));
LOG.trace("Sending request [{}] from exchange [{}]...", request, exchange);
PublishResult result = getEndpoint().getSNSClient().publish(request);
LOG.trace("Received result [{}]", result);
Message message = getMessageForResponse(exchange);
message.setHeader(SnsConstants.MESSAGE_ID, result.getMessageId());
}
Aggregations