当前位置: 首页>>代码示例>>Java>>正文


Java RabbitHandler类代码示例

本文整理汇总了Java中org.springframework.amqp.rabbit.annotation.RabbitHandler的典型用法代码示例。如果您正苦于以下问题:Java RabbitHandler类的具体用法?Java RabbitHandler怎么用?Java RabbitHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RabbitHandler类属于org.springframework.amqp.rabbit.annotation包,在下文中一共展示了RabbitHandler类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processLogMessage

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitListener(queues = AppLogConfig.O2O_LOG_QUEUE)
@RabbitHandler
public void processLogMessage(Object message) {
    try {
        if (number <= 0) {
            logger.info("====== game over ======");
            return;
        }
        logger.info("====> receive message, number=" + number);
        number--;
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:Evan1120,项目名称:springboot-sample,代码行数:15,代码来源:MessageHanlder.java

示例2: receiveCheckQueueMessage

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
/**
 * 处理更新记录消息
 */
@RabbitHandler
@RabbitListener(queues = "LianJiaCrawler.Check.Queue")
public void receiveCheckQueueMessage(Message message) {
    try {
        byte[] dataArray = message.getBody();
        LOGGER.info("【接收消息】>>>队列目的地:{}", message.getMessageProperties().getConsumerQueue());
        crawlerService.saveCheckData(dataArray);
    } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
    }
}
 
开发者ID:lupindong,项目名称:xq_seckill_microservice,代码行数:15,代码来源:MqCustomer.java

示例3: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(@Payload CrispyBunOrder order) {
	StringBuffer SB = new StringBuffer();
	SB.append("New Order Received : \n");
	SB.append("OrderId : " + order.getOrderId());
	SB.append("\nItemId : " + order.getItemId());
	SB.append("\nUserName : " + order.getUserName());
	SB.append("\nDate : " + order.getOrderPlacedTime());
	System.out.println(SB.toString());
}
 
开发者ID:PacktPublishing,项目名称:Practical-Microservices,代码行数:11,代码来源:EventConsumerApplication.java

示例4: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler  
public void process(String content) {  
    System.out.println("Receiver : " + content);  
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:5,代码来源:Reciever.java

示例5: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler  
public LoginDetails process(String content) {  
      Integer id = Integer.parseInt(content);
      LoginDetails details = logindetailsServiceImpl.findLoginById(id);
      return details ;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:7,代码来源:RequestListLogins.java

示例6: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler  
public Flux<LoginDetails> process(String content) {  
      Integer id = Integer.parseInt(content);
      Flux<LoginDetails> details =Flux.just(logindetailsServiceImpl.findLoginById(id));
      return details ;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:7,代码来源:RequestFluxLogins.java

示例7: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(byte[] msg) {
    mythMqReceiveService.processMessage(msg);
}
 
开发者ID:yu199195,项目名称:myth,代码行数:5,代码来源:RabbitConsumer.java

示例8: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(String hello) {
    System.out.println("Receiver : " + hello);
}
 
开发者ID:nellochen,项目名称:springboot-start,代码行数:5,代码来源:Receiver.java

示例9: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(String hello) {
    System.out.println("Consumer : " + hello);
}
 
开发者ID:jeikerxiao,项目名称:SpringBootStudy,代码行数:5,代码来源:Consumer.java

示例10: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(String hello) {
    System.out.println("Receiver  : " + hello);
}
 
开发者ID:wyp0596,项目名称:elegant-springboot,代码行数:5,代码来源:MsgConsumer.java

示例11: receiveQueue

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void receiveQueue(String text) {  
    System.out.println("Consumer收到的报文为:"+text);  
}
 
开发者ID:ranji1221,项目名称:lemcloud,代码行数:5,代码来源:Consumer.java

示例12: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(@Payload String data) {
	System.out.println(new Date() + ": " + data);
}
 
开发者ID:adarshkumarsingh83,项目名称:spring_boot,代码行数:5,代码来源:AmqpApplicationDriver.java

示例13: process

import org.springframework.amqp.rabbit.annotation.RabbitHandler; //导入依赖的package包/类
@RabbitHandler
public void process(@Payload String foo) {
	System.out.println(new Date() + ": " + foo);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:SampleAmqpSimpleApplication.java


注:本文中的org.springframework.amqp.rabbit.annotation.RabbitHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。