digitalmars.D.announce - RabbitMQ client library for D! Hunt AMQP Client.
- zoujiaqing (64/64) Dec 12 2019 Hunt AMQP Client 1.0.0 beta is released!
- aberba (2/6) Dec 13 2019 👍 Clean API design
Hunt AMQP Client 1.0.0 beta is released! Hunt AMQP Client based AMQP protocol 1.0, support for RabbitMQ and other AMQP Server. Ported from Vert.x AMQP Client. Sample code: ```D import hunt.amqp; import hunt.logging; void main() { AmqpClientOptions options = new AmqpClientOptions() .setHost("localhost") .setPort(5672) .setUsername("test") .setPassword("123"); AmqpClient client = AmqpClient.create(options); client.connect(new class Handler!AmqpConnection { void handle(AmqpConnection conn) { if (conn is null) { logWarning("Unable to connect to the broker"); return; } logInfo("Connection succeeded"); conn.createSender("my-queue",new class Handler!AmqpSender{ void handle(AmqpSender sender) { if(sender is null) { logWarning("Unable to create a sender"); return; } for (int i = 0 ; i < 100; ++i) { sender.send(AmqpMessage.create().withBody("hello world").build()); logInfo("send complite"); } } }); conn.createReceiver("my-queue", new class Handler!AmqpReceiver { void handle(AmqpReceiver recv) { if(recv is null) { logWarning("Unable to create a receiver"); return; } recv.handler(new class Handler!AmqpMessage { void handle(AmqpMessage msg){ logInfo("Received %s" , msg.bodyAsString()); } }); } }); } }); } ``` DLang Code: https://code.dlang.org/packages/hunt-amqp-client Github Repository: https://github.com/huntlabs/hunt-amqp-client
Dec 12 2019
On Thursday, 12 December 2019 at 10:04:29 UTC, zoujiaqing wrote:Hunt AMQP Client 1.0.0 beta is released! Hunt AMQP Client based AMQP protocol 1.0, support for RabbitMQ and other AMQP Server. Ported from Vert.x AMQP Client. [...]👍 Clean API design
Dec 13 2019