Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Micronaut AMQP的请求/响应模式_Java_Micronaut_Micronaut Client_Micronaut Rest - Fatal编程技术网

Java Micronaut AMQP的请求/响应模式

Java Micronaut AMQP的请求/响应模式,java,micronaut,micronaut-client,micronaut-rest,Java,Micronaut,Micronaut Client,Micronaut Rest,我正在尝试使用Micronaut AMQP执行请求/响应模式,如下图所示 制作人 @RabbitClient(ProductTopicConstants.FETE_BIRD_EXCHANGE) @RabbitProperty(name = "replyTo", value = "amq.rabbitmq.reply-to") public interface IProductProducer { @Binding(P

我正在尝试使用Micronaut AMQP执行请求/响应模式,如下图所示

制作人

  @RabbitClient(ProductTopicConstants.FETE_BIRD_EXCHANGE)
    @RabbitProperty(name = "replyTo", value = "amq.rabbitmq.reply-to") 
    public interface IProductProducer {
        @Binding(ProductTopicConstants.GET_FREE_TEXT_SEARCH)
        Flowable<Product> findFreeText(String text);
    }
@RabbitListener
public class ProductListener {
@Queue(ProductTopicConstants.GET_FREE_TEXT_SEARCH)
    public Flowable<Product> findByFreeText(String text) {
        LOG.info(String.format("Listener --> Listening value = %s", text));
        return Flowable.fromPublisher(repository.getCollection("product", Product.class)
                .find(new Document("$text",
                        new Document("$search", text)
                                .append("$caseSensitive", false)
                                .append("$diacriticSensitive", false)
                )));
    }}
@RabbitClient(ProductTopicConstants.FETE\u BIRD\u交换)
@RabbitProperty(name=“replyTo”,value=“amq.rabbitmq.reply to”)
公共接口IPProductProducer{
@绑定(ProductTopicConstants.GET\u FREE\u TEXT\u SEARCH)
可流动findFreeText(字符串文本);
}
听众

  @RabbitClient(ProductTopicConstants.FETE_BIRD_EXCHANGE)
    @RabbitProperty(name = "replyTo", value = "amq.rabbitmq.reply-to") 
    public interface IProductProducer {
        @Binding(ProductTopicConstants.GET_FREE_TEXT_SEARCH)
        Flowable<Product> findFreeText(String text);
    }
@RabbitListener
public class ProductListener {
@Queue(ProductTopicConstants.GET_FREE_TEXT_SEARCH)
    public Flowable<Product> findByFreeText(String text) {
        LOG.info(String.format("Listener --> Listening value = %s", text));
        return Flowable.fromPublisher(repository.getCollection("product", Product.class)
                .find(new Document("$text",
                        new Document("$search", text)
                                .append("$caseSensitive", false)
                                .append("$diacriticSensitive", false)
                )));
    }}
@RabbitListener
公共类ProductListener{
@队列(ProductTopicConstants.GET\u FREE\u TEXT\u SEARCH)
公共可流动findByFreeText(字符串文本){
LOG.info(String.format(“侦听器-->侦听值=%s”,文本));
返回Flowable.fromPublisher(repository.getCollection(“产品”),product.class)
.find(新文档(“$text”),
新文档(“$search”,文本)
.append(“$caseSensitive”,false)
.append($diacriticSensitive),false)
)));
}}

对于它正在工作的请求,请了解我如何执行返回控制器的响应,以及如何使用AMQP协议和micronaut与消息代理异步实现此模式。

您能否再解释一下,您的图片有什么意义?我是不是搞错了,还是出了什么问题?@IEE1394我正试图根据本文档实现从监听器方法到制作者方法的响应,但我总是会超时。我发现一个例外:它与您的图片的工作方式完全不同