return new AmqpConnection(options);
}
private AmqpConnection(AmqpConnectOptions options) {
transport = AmqpTransport.connect(options);
transport.setListener(new AmqpListener() {
@Override
public void processDelivery(Delivery delivery) {
Attachment attachment = (Attachment) getTransport().context(delivery.getLink()).getAttachment();
AmqpLink link = (AmqpLink) attachment.endpoint();
link.processDelivery(delivery);