Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,7 @@
import org.springframework.amqp.rabbit.test.mockito.LatchCountDownAndCallRealMethodAnswer;
import org.springframework.aop.framework.ProxyFactoryBean;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.MergedAnnotations;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.test.util.AopTestUtils;
import org.springframework.util.Assert;
Expand Down Expand Up @@ -172,9 +172,9 @@ private static final class CaptureAdvice implements MethodInterceptor {

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
boolean isListenerMethod =
AnnotationUtils.findAnnotation(invocation.getMethod(), RabbitListener.class) != null
|| AnnotationUtils.findAnnotation(invocation.getMethod(), RabbitHandler.class) != null;
MergedAnnotations annotations = MergedAnnotations.from(invocation.getMethod());
boolean isListenerMethod = annotations.isPresent(RabbitListener.class)
|| annotations.isPresent(RabbitHandler.class);
try {
Object result = invocation.proceed();
if (isListenerMethod) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -139,6 +139,11 @@ public Queue queue2() {
return new AnonymousQueue();
}

@Bean
public Queue queue3() {
return new AnonymousQueue();
}

@Bean
public RabbitAdmin admin(ConnectionFactory cf) {
return new RabbitAdmin(cf);
Expand Down Expand Up @@ -168,6 +173,7 @@ public String foo(String foo) {
}

@RabbitListener(id = "bar", queues = "#{queue2.name}")
@RabbitListener(id = "bar2", queues = "#{queue3.name}")
public void foo(@Payload String foo, @Header("amqp_receivedRoutingKey") String rk) {
if (!failed && foo.equals("ex")) {
failed = true;
Expand Down