Address IllegalAccessException in Kafka Streams binder

When StreamListener methods are contained in a top level non-public class, Kafka
Streams binder throws an IllegalAccessException. Fixing it by making it accessible.

Resolves #348
This commit is contained in:
Soby Chacko
2018-03-28 23:56:04 -04:00
parent 710ff2c292
commit 84f0fb28ae
2 changed files with 3 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
/**
@@ -155,6 +156,7 @@ class KafkaStreamsStreamListenerSetupMethodOrchestrator implements StreamListene
this.applicationContext,
this.streamListenerParameterAdapter);
try {
ReflectionUtils.makeAccessible(method);
if (Void.TYPE.equals(method.getReturnType())) {
method.invoke(bean, adaptedInboundArguments);
}

View File

@@ -119,7 +119,7 @@ public class KafkaStreamsBinderWordCountIntegrationTests {
@EnableBinding(KafkaStreamsProcessor.class)
@EnableAutoConfiguration
@EnableConfigurationProperties(KafkaStreamsApplicationSupportProperties.class)
public static class WordCountProcessorApplication {
static class WordCountProcessorApplication {
@Autowired
private TimeWindows timeWindows;