All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lv.ctco.cukes.rabbitmq.internal.QueueService Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
package lv.ctco.cukes.rabbitmq.internal;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.rabbitmq.client.Channel;
import lombok.SneakyThrows;

import java.io.IOException;

@Singleton
public class QueueService {

    @Inject
    ConnectionService connectionService;

    @SneakyThrows(IOException.class)
    public void declareQueue(String queueName, String exchange, String routingKey) {
        Channel channel = connectionService.getChannel();
        channel.queueDeclare(queueName, false, true,true, null);
        channel.queueBind(queueName, exchange, routingKey);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy