Java Examples for org.springframework.amqp.rabbit.annotation.RabbitHandler

The following java examples will help you to understand the usage of org.springframework.amqp.rabbit.annotation.RabbitHandler. These source code samples are taken from different open source projects.

Example 1
Project: springboot-dubbox-master  File: SampleAmqpSimpleApplication.java View source code
@RabbitHandler
public void process(@Payload String foo) {
    //邮件发送
    //        SimpleMailMessage message = new SimpleMailMessage();
    //        message.setFrom("aaa@xxx.com");
    //        message.setTo("bbb@xxx.com");
    //        message.setSubject("主题:测试邮件");
    //        message.setText("测试邮件内容" + new Date() + ": " + foo);
    //        mailSender.send(message);
    System.out.println(new Date() + ": " + foo);
}
Example 2
Project: spring-amqp-master  File: RabbitListenerTestHarness.java View source code
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
    Object result = null;
    boolean isListenerMethod = AnnotationUtils.findAnnotation(invocation.getMethod(), RabbitListener.class) != null || AnnotationUtils.findAnnotation(invocation.getMethod(), RabbitHandler.class) != null;
    try {
        result = invocation.proceed();
        if (isListenerMethod) {
            this.invocationData.put(new InvocationData(invocation, result));
        }
    } catch (// NOSONAR - rethrown below
    Throwable // NOSONAR - rethrown below
    t) {
        if (isListenerMethod) {
            this.invocationData.put(new InvocationData(invocation, t));
        }
        throw t;
    }
    return result;
}
Example 3
Project: SpringBoot-Learning-master  File: Receiver.java View source code
@RabbitHandler
public void process(String hello) {
    System.out.println("Receiver : " + hello);
}
Example 4
Project: j360-boot-master  File: RabbitListenerHandler.java View source code
@RabbitHandler
public void process(@Payload String foo) {
    System.out.println(new Date() + ": " + foo);
}
Example 5
Project: rabbitmq-tutorials-master  File: Tut1Receiver.java View source code
@RabbitHandler
public void receive(String in) {
    System.out.println(" [x] Received '" + in + "'");
}
Example 6
Project: SpringCloudBook-master  File: Receiver.java View source code
@RabbitHandler
public void process(String hello) {
    System.out.println("Receiver : " + hello);
}
Example 7
Project: spring-boot-master  File: SampleAmqpSimpleApplication.java View source code
@RabbitHandler
public void process(@Payload String foo) {
    System.out.println(new Date() + ": " + foo);
}