public void sendMessage(String path, BrokeredMessage message) {
Builder request = getResource().path(path).path("messages")
.getRequestBuilder();
if (message.getContentType() != null) {
request = request.type(message.getContentType());
}
if (message.getBrokerProperties() != null) {
request = request.header("BrokerProperties",
mapper.toString(message.getBrokerProperties()));