}
public void Send(OMElement message) throws AMQPException {
try {
if (isRoutable(message)) {
Connection connection = connectionFactory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_DIRECT, AMQPUtil.EXCHANGE_TYPE_DIRECT);
List<String> routingKeys = new ArrayList<String>();
getRoutingKeys(message, routingKeys);
for (String routingKey : routingKeys) {
channel.basicPublish(
AMQPUtil.EXCHANGE_NAME_DIRECT, routingKey, null, message.toString().getBytes());
}
channel.close();
connection.close();
}
} catch (IOException e) {
throw new AMQPException(e);
}
}