After I enabled bindings actuator endpoints by setting the following property: management.endpoints.web.exposure.include=bindings
, I am supposed to see the bindings(consumer) properties.
However, after I added spring cloud bus dependency and also enable spring cloud bus, I can only see bindings properties for springCloudBus but not the bindings that I created in my project.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-kafka</artifactId>
</dependency>
QUESTION: How to ensure that we can still see the bindings that we created after we enable spring cloud bus?
When I set spring.cloud.bus.enabled=false
, I got the following result
[
{
"name": "TestInput",
"group": null,
"pausable": true,
"state": "running",
"extendedInfo": {
"bindingDestination": "KafkaConsumerDestination{consumerDestinationName='TestInput', partitions=1, dlqName='null'}",
"ExtendedConsumerProperties": {
"concurrency": 1,
"instanceCount": 1,
"maxAttempts": 3,
"backOffInitialInterval": 1000,
"backOffMaxInterval": 10000,
"backOffMultiplier": 2,
"extension": {
"ackEachRecord": false,
"autoRebalanceEnabled": true,
"autoCommitOffset": true,
"autoCommitOnError": null,
"startOffset": null,
"resetOffsets": false,
"enableDlq": false,
"dlqName": null,
"dlqProducerProperties": {
"bufferSize": 16384,
"compressionType": "none",
"sync": false,
"batchTimeout": 0,
"messageKeyExpression": null,
"headerPatterns": null,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
},
"recoveryInterval": 5000,
"trustedPackages": null,
"standardHeaders": "none",
"converterBeanName": null,
"idleEventInterval": 30000,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
}
}
}
},
{
"name": "TestInput2",
"group": null,
"pausable": true,
"state": "running",
"extendedInfo": {
"bindingDestination": "KafkaConsumerDestination{consumerDestinationName='TestInput2', partitions=1, dlqName='null'}",
"ExtendedConsumerProperties": {
"concurrency": 1,
"instanceCount": 1,
"maxAttempts": 3,
"backOffInitialInterval": 1000,
"backOffMaxInterval": 10000,
"backOffMultiplier": 2,
"extension": {
"ackEachRecord": false,
"autoRebalanceEnabled": true,
"autoCommitOffset": true,
"autoCommitOnError": null,
"startOffset": null,
"resetOffsets": false,
"enableDlq": false,
"dlqName": null,
"dlqProducerProperties": {
"bufferSize": 16384,
"compressionType": "none",
"sync": false,
"batchTimeout": 0,
"messageKeyExpression": null,
"headerPatterns": null,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
},
"recoveryInterval": 5000,
"trustedPackages": null,
"standardHeaders": "none",
"converterBeanName": null,
"idleEventInterval": 30000,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
}
}
}
}
]
After I set spring.cloud.bus.enabled=true
, I can only see the properties for springCloudBus
[
{
"name": "springCloudBus",
"group": null,
"pausable": true,
"state": "running",
"extendedInfo": {
"bindingDestination": "KafkaConsumerDestination{consumerDestinationName='springCloudBus', partitions=1, dlqName='null'}",
"ExtendedConsumerProperties": {
"concurrency": 1,
"instanceCount": 1,
"maxAttempts": 3,
"backOffInitialInterval": 1000,
"backOffMaxInterval": 10000,
"backOffMultiplier": 2,
"extension": {
"ackEachRecord": false,
"autoRebalanceEnabled": true,
"autoCommitOffset": true,
"autoCommitOnError": null,
"startOffset": null,
"resetOffsets": false,
"enableDlq": false,
"dlqName": null,
"dlqProducerProperties": {
"bufferSize": 16384,
"compressionType": "none",
"sync": false,
"batchTimeout": 0,
"messageKeyExpression": null,
"headerPatterns": null,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
},
"recoveryInterval": 5000,
"trustedPackages": null,
"standardHeaders": "none",
"converterBeanName": null,
"idleEventInterval": 30000,
"configuration": {},
"admin": {
"replicationFactor": null,
"replicasAssignments": {},
"configuration": {}
}
}
}
}
}
]
Steps to replicate:
Clone the project from https://github.com/HLTan94/SpringCloudStreamBindingsDemo
Set spring.cloud.bus.enabled
Execute curl -X GET http://localhost:9999/bindings
I was able to reproduce it and discovered that this is actually a bug on our end. You can track it here. In any event we should have a service release by the end of July (i.e., 2.0.2)