-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigsBuilder properties (LeaseManagementConfig, CoordinatorConfig .....) can't be set or overridden in KclMessageDrivenChannelAdapter
using KinesisClientLibConfiguration
#224
Comments
That doc looks out-dated and has to be fixed respectively.
and so on.
Then a Will be fixed in Spring Integration AWS soon enough. Thanks |
Thanks @artembilan for acknowledging and quick response As I understood we can expect some configurer which can help us to override the individual pieces of config. |
That's correct. |
Also, If we are thinking about the As I can see init(), dostart() method in Currently, this step comes after the customizer configuration which eventually can override the configuration made in the customizer. |
Well, that's not true.
So, first that customizer is called, and only then the mentioned |
In the
So, whatever could be set by the |
Yeah, that makes sense, and like this, all the configs can be managed 👍 , so the priority would be always to customizer over |
That's correct. If you set those customizers for specific config, that will win over configuration properties. |
To be honest I have tried to override the adapter instance in Customizer using reflection but turned out that config and scheduler instance variables are getting overridden due to instance assignment as you can see below so not sure of the order though. @Override
protected void onInit() {
super.onInit();
this.config =
new ConfigsBuilder(buildStreamTracker(),
this.consumerGroup,
this.kinesisClient,
this.dynamoDBClient,
this.cloudWatchClient,
this.workerId,
this.recordProcessorFactory);
}
@Override
protected void doStart() {
super.doStart();
if (ListenerMode.batch.equals(this.listenerMode) && CheckpointMode.record.equals(this.checkpointMode)) {
this.checkpointMode = CheckpointMode.batch;
logger.warn("The 'checkpointMode' is overridden from [CheckpointMode.record] to [CheckpointMode.batch] "
+ "because it does not make sense in case of [ListenerMode.batch].");
}
LifecycleConfig lifecycleConfig = this.config.lifecycleConfig();
lifecycleConfig.taskBackoffTimeMillis(this.consumerBackoff);
RetrievalSpecificConfig retrievalSpecificConfig;
String singleStreamName = this.streams.length == 1 ? this.streams[0] : null;
if (this.fanOut) {
retrievalSpecificConfig =
new FanOutConfig(this.kinesisClient)
.applicationName(this.consumerGroup)
.streamName(singleStreamName);
}
else {
retrievalSpecificConfig =
new PollingConfig(this.kinesisClient)
.streamName(singleStreamName);
}
RetrievalConfig retrievalConfig = this.config.retrievalConfig()
.glueSchemaRegistryDeserializer(this.glueSchemaRegistryDeserializer)
.retrievalSpecificConfig(retrievalSpecificConfig);
MetricsConfig metricsConfig = this.config.metricsConfig();
metricsConfig.metricsLevel(this.metricsLevel);
this.scheduler =
new Scheduler(
this.config.checkpointConfig(),
this.config.coordinatorConfig(),
this.config.leaseManagementConfig(),
lifecycleConfig,
metricsConfig,
this.config.processorConfig(),
retrievalConfig);
this.executor.execute(this.scheduler);
} |
Right. That's what I meant with a "not self-containing entity".
So, we have to first call this, then customize it, and only after that push down to the
|
Thanks @artembilan for explaining the changes and sorting the issue, will be looking forward for the changes in the next iteration |
spring-projects/spring-integration-aws@c113391#r147137622
retrievalConfig.retrievalSpecificConfig(
new PollingConfig(this.kinesisClient).maxRecords(...);
retrievalConfig.initialPositionInStreamExtended(
newInitialPosition(..);
}
|
I have answered you over there so far.
See It is really recommended by KCL to use a fan-out mode, not polling. |
The fix is in. |
In version 2.0.1, we could override the Kinesis KCL configuration in
KclMessageDrivenChannelAdapter
usingKinesisClientLibConfiguration
as described in the documentation.However, in the latest version (4.0.3), we need to set properties such as maxLeasesForWorker, maxLeasesToStealAtOneTime, and other lease management configurations in the
KclMessageDrivenChannelAdapter
scheduler (via LeaseManagementConfig). Additionally, we are looking for a method to override other configurations usingConfigsBuilder
, especially for properties that are not directly exposed inKinesisConsumerProperties
.Could you please add the support or guide on how to configure the ConfigsBuilder for setting these lower-level configurations?
The text was updated successfully, but these errors were encountered: