I am using @StreamListner, created input binding of type SubscribableChannel & trying to connect to a pre-provisioned queue and used similar configurations as suggested in previous comment but i am not able to bind consumer with queue .
Getting error - “EL1008E: Property or field ‘isAnonymous’ cannot be found on object of type ‘com.solace.spring.cloud.stream.binder.provisioning.ExpressionContextRoot’ - maybe not public or not valid?” .
Did try providing queue-name-expression as well as string literal as suggested in blog post https://solace.com/blog/custom-name-for-queues-spring-cloud-stream-binder/ nothing seems to work i keep in getting above error or SpelExpression error i.e. Caused by: org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: ‘rparen())’ .
Hi @chatumoh , Can you share the application configuration snippet around the solace binding configuration?
@giri
Below is the solace binder configuration which I am using in my sprint boot app.
I gave it a try using queueNameExpression passed an SpEL expression and a hard coded literal but no luck. I am using spring-cloud-starter-stream-solace v3.4
spring:
cloud:
stream:
binders:
solace-broker:
type: solace
environment:
solace:
java:
host: tcps://host.company.com:55443
msgVpn: <>
clientUsername: <>
clientPassword: <>
connectRetries: 3
connectRetriesPerHost: 0
reconnectRetries: 3
apiProperties:
ssl_trust_store: ‘<<trust_store>>’
bindings:
inputChannel:
destination: queueName
group: mygroup
binder: solace-broker
solace:
bindings:
inputChannel:
consumer:
provisionSubscriptionsToDurableQueue: false
provisionDurableQueue: false
queue-name-prefix: ‘’
#queueNameExpression: “(properties.solace.queueNamePrefix.trim()) + (properties.solace.useGroupNameInQueueName ? group?.trim() + ‘-’ : ‘’)) + (properties.solace.useDestinationEncodingInQueueName ? ‘plain’ + ‘-’ : ‘’) + destination.trim().replaceAll(‘[*>]’, ‘-’)”
#queueNameExpression: “‘queueName’”
useFamiliarityInQueueName: false
useDestinationEncodingInQueueName: false
useGroupNameInQueueName: false
queue-additional-subscriptions: “‘topic/group/>’”
Hi @chatumoh ,
Any reason you’re using @StreamListener ? That way of defining a listener was deprecated quite a while ago now. I’m not sure, but that could be causing the issue with the queueNameExpression property not working.
If you can, I would suggest moving to use Spring Cloud Function to define your message handlers. Here is an example that @giri made which shows a custom queue using them: solace-samples-spring/cloud-stream-custom-queue-names at master · SolaceSamples/solace-samples-spring · GitHub .
Note for lowercase-in-0 all he had to do we define the properties here: solace-samples-spring/cloud-stream-custom-queue-names/src/main/resources/application.yaml at master · SolaceSamples/solace-samples-spring · GitHub
@marc.dipasquale >
I was able to connect to pre-provisioned queue after downgrading solace binder dependency to v3.2 with @StreamListener in SCST version earlier than v3.1. My microservice app is already connecting to Kafka broker using @StreamListener annotation & earlier scst version, i am adding solace as additional messaging source to read from
As below consumer properties to disable SCST default approach of connecting to queue were deprecated since v3.3 I changed queueNameExpression and kept just the destination name in SpEL expression as well as tried just providing queueName as literal queueNameExpression: ‘’‘queuename’‘’ but still getting same error with SCST solace binder v3.4 and v3.3
provisionSubscriptionsToDurableQueue, queueNamePrefix, useFamiliarityInQueueName, useDestinationEncodingInQueueName, useGroupNameInQueueName