Skip to content

Commit 2dc1ecb

Browse files
committed
Add param variable for group id
1 parent 783cde3 commit 2dc1ecb

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

async/async-kafka/src/main/java/org/reactivecommons/async/kafka/listeners/ApplicationEventListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ public ApplicationEventListener(ReactiveMessageListener receiver,
3333
DiscardNotifier discardNotifier,
3434
CustomReporter errorReporter,
3535
String appName) {
36+
37+
3638
super(receiver, withDLQRetry, createTopology, maxRetries, retryDelay, discardNotifier,
3739
"event", errorReporter, appName, resolver.getEventNames());
40+
3841
this.resolver = resolver;
3942
this.messageConverter = messageConverter;
4043
}

starters/async-commons-starter/src/main/java/org/reactivecommons/async/starter/props/GenericAsyncProps.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@SuperBuilder
1414
public abstract class GenericAsyncProps<P> {
1515
private String appName;
16+
private String groupId;
1617
private String secret;
1718

1819
public abstract void setConnectionProperties(P properties);

starters/async-commons-starter/src/main/java/org/reactivecommons/async/starter/props/GenericAsyncPropsDomain.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class GenericAsyncPropsDomain<T extends GenericAsyncProps<P>, P> extends
2222
private Class<P> propsClass;
2323

2424
public GenericAsyncPropsDomain(String defaultAppName,
25+
String groupId,
2526
P defaultProperties,
2627
GenericAsyncPropsDomainProperties<T, P> configured,
2728
SecretFiller<P> secretFiller,
@@ -44,7 +45,10 @@ public GenericAsyncPropsDomain(String defaultAppName,
4445
+ " has not set the property appName. please use respective property or " +
4546
" spring.application.name property or withDefaultAppName in builder");
4647
}
47-
value.setAppName(defaultAppName);
48+
if(value.getGroupId() != null){
49+
value.setAppName(groupId);
50+
}
51+
value.setAppName(defaultAppName + "-events");
4852
}
4953
if (value.getConnectionProperties() == null) {
5054
if (defaultProperties == null) {

starters/async-kafka-starter/src/main/java/org/reactivecommons/async/kafka/config/props/AsyncKafkaPropsDomain.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
public class AsyncKafkaPropsDomain extends GenericAsyncPropsDomain<AsyncKafkaProps, KafkaProperties> {
1414

1515
public AsyncKafkaPropsDomain(@Value("${spring.application.name}") String defaultAppName,
16+
@Value("${spring.kafka.consumer.group.id}") String groupId,
1617
KafkaProperties defaultKafkaProperties,
1718
AsyncKafkaPropsDomainProperties configured,
1819
KafkaSecretFiller kafkaSecretFiller) {
19-
super(defaultAppName, defaultKafkaProperties, configured, kafkaSecretFiller, AsyncKafkaProps.class,
20+
super(defaultAppName, groupId, defaultKafkaProperties, configured, kafkaSecretFiller, AsyncKafkaProps.class,
2021
KafkaProperties.class);
2122
}
2223

0 commit comments

Comments
 (0)