🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
Unable to connect to existing solace queue instead trying to creating a new durable queue and fails
Asking help from this community after coming through several articles and sites. Didn't find solution
I want to connect and use manually created queue, but it is not working. refer the below properties and error i am getting.
Any recommendations?
Details
Spring Boot Applicaiton created using start.spring.ip with the dependencies pubsub+, solace and Web modules
Using spring cloud stream framework
Created a queue using the solace admin console
Used the following application properties
spring.cloud.stream.function.definition=
spring.cloud.stream.binder=solace
spring.cloud.stream.bindings.-in-0.destination=
spring.cloud.stream.bindings.-in-0.group=
spring.cloud.stream.solace.bindings.-in-0.consumer.autoBindDmq=true
spring.cloud.stream.solace.bindings.-in-0.consumer.provisionDurableQueue=false
spring.cloud.stream.solace.bindings.-in-0.consumer.provisionSubscriptionsToDurableQueue=false
spring.cloud.stream.bindings.-in-0.consumer.concurrency=3
spring.cloud.stream.binders.solace.type=solace
spring.cloud.stream.binders.solace.environment.solace.java.host=
spring.cloud.stream.binders.solace.environment.solace.java.msgVpn=
spring.cloud.stream.binders.solace.environment.solace.java.clientUsername=
spring.cloud.stream.binders.solace.environment.solace.java.clientPassword=
c.s.s.c.s.b.p.SolaceQueueProvisioner : Creating durable queue scst/wk/ for consumer group
c.s.jcsmp.impl.SessionModeSupport : (Client name:
<
address info>- Error Response (403) - Permission Not Allowed
c.s.s.c.s.b.p.SolaceQueueProvisioner : Failed to provision durable queue scst/wk/
com.solacesystems.jcsmp.JCSMPErrorResponseException: 403: Permission Not Allowed
Comments
-
Hi @nbommidi,
Can you post your config using ``` before and after so it puts it into a code blocK? It's hard to make out how it is. I assume there are some angle brackets in there that are getting lost.Also if you're creating the queue and applying the subscriptions ahead of time you can set these properties to tell the binder not to. Find out more info on them in the Solace Consumer Properties docs section.
provisionDurableQueue = false
provisionSubscriptionsToDurableQueue = false
provisionErrorQueue = false
(if you're using the error queue)
0 -
Hi @marc
I have used denotation to represent the values. looks like they are lost
See below updatd config
spring.cloud.stream.function.definition= testConsumer
spring.cloud.stream.binder=solace
spring.cloud.stream.bindings.testConsumer-in-0.destination= preconfigured queue name
spring.cloud.stream.bindings.testConsumer-in-0.group= testConsumerGroup
spring.cloud.stream.solace.bindings.testConsumer-in-0.consumer.autoBindDmq=true
spring.cloud.stream.solace.bindings.testConsumer-in-0.consumer.provisionDurableQueue=false
spring.cloud.stream.solace.bindings.testConsumer-in-0.consumer.provisionSubscriptionsToDurableQueue=false
spring.cloud.stream.bindings.testConsumer-in-0.consumer.concurrency=3spring.cloud.stream.binders.solace.type=solace
spring.cloud.stream.binders.solace.environment.solace.java.host= host name
spring.cloud.stream.binders.solace.environment.solace.java.msgVpn= vpn name
spring.cloud.stream.binders.solace.environment.solace.java.clientUsername= user name
spring.cloud.stream.binders.solace.environment.solace.java.clientPassword= passwordBelow is the part of the error log where it is trying to create a durable queue and failing due to a permission issue with a 403 error. my org didn't allow an application to create a queue.
c.s.s.c.s.b.p.SolaceQueueProvisioner : Creating durable queue scst/wk/ for consumer group
c.s.jcsmp.impl.SessionModeSupport : (Client name:0 -
Hi @nbommidi,
Your configuration looks close to correct to me so a few things to check:
1. What version of the cloud stream binder are you using? If using the latest you'll want to useautoBindErrorQueue
instead ofautoBindDmq
2. Since you are using that feature you'll also want to addprovisionErrorQueue: false
3. If the disabling of provisioning is being properly read by the binder you should see logs that look something like this:Creating durable queue scst/wk/SINK/plain/TEMPS.Q for consumer group SINK Durable queue provisioning is disabled, scst/wk/SINK/plain/TEMPS.Q will not be provisioned nor will its configuration be validated
Note that this worked for me using the
cloud-streams-sink
sample in this repo with this config:spring: cloud: function: definition: sink stream: bindings: sink-in-0: destination: TEMPS.Q #The presence of "group" tells the binder to follow the "consumer group" pattern group: SINK solace: bindings: sink-in-0: consumer: #This adds a topic subscription w/ wildcards to the queue created with a name of TEMPS.Q.SINK above queueAdditionalSubscriptions: sensor/temperature/> autoBindErrorQueue: true provisionDurableQueue: false provisionSubscriptionsToDurableQueue: false provisionErrorQueue: false
0 -
Hey @marc, I did see that disable note when I tried several options earlier. I used to get an invalid queue or permission issue. But now I did further analysis of all my properties in earlier trials as well.
The problem was that our predefined queue didn't accept any prefix in the queue name, but the spring cloud binder configuration automatically add the prefix with all defaults and it resulted in an invalid queue.
I tried to use all the below properties as mentioned in the documentation at https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#generated-queue-name-syntax
useDestinationEncodingInQueue =false
useGroupNameInQueueName=false
useFamiliarityInQueueName=falseI have observed the group name and familiarity name is removed from the prefix, but the encoding isn't removed.
So I did a code review of the source code and realized that there is a typo in the property. The actual property should be useDestinationEncodingInQueueName
Now I am able to fix the invalid queue issue.
You may have to advise your team to correct the documentation. Sorry, I didn't set it up to fix it.
1 -
Great find @nbommidi. I opened this PR to fix it in the docs: https://github.com/SolaceProducts/solace-spring-cloud/pull/90
Thank you 🙏
1 -
Hi, Not sure sure any one is getting the same error now, but I am getting it now.
I am using <solace-spring-cloud.version>2.1.0</solace-spring-cloud.version> and the following is my config
spring:
cloud:
function:
definition: consumeMessage
stream:
bindings:
consumeMessage-in-0:
destination: test
group: queue.dev
solace:
bindings:
consumeMessage-in-0:
consumer:
queueAdditionalSubscriptions: test/dev
autoBindErrorQueue: true
provisionDurableQueue: false
provisionSubscriptionsToDurableQueue: false
provisionErrorQueue: falseI have already created a user defined non-exclusive queue from sol admin with the name test.queue.dev
I am getting the following error
c.s.s.c.s.b.p.SolaceQueueProvisioner : Creating durable queue scst/wk/queue.dev/plain/test for consumer group queue.dev
c.s.s.c.s.b.p.SolaceQueueProvisioner : Durable queue provisioning is disabled, scst/wk/queue.dev/plain/test will not be provisioned nor will its configuration be validated
c.s.s.c.s.b.p.SolaceQueueProvisioner : Testing consumer flow connection to queue scst/wk/queue.dev/plain/test (will not start it)
c.s.s.c.s.b.p.SolaceQueueProvisioner : Failed to connect test consumer flow to queue scst/wk/queue.dev/plain/test. Provisioning is disabled, queue was not provisioned nor was its configuration validated.com.solacesystems.jcsmp.JCSMPErrorResponseException: 503: Unknown Queue
at com.solacesystems.jcsmp.impl.flow.BindRequestTask.execute(BindRequestTask.java:204) ~[sol-jcsmp-10.10.0.jar:na]0 -
I did more testing here are my latest config and the exception, nbot sure why it is creating anonymous queue here
spring.cloud.stream.function.definition= consumeMessage
spring.cloud.stream.binder=solace
spring.cloud.stream.bindings.consumeMessage-in-0.destination= test.queue.dev
spring.cloud.stream.bindings.testConsumer-in-0.group= testConsumerGroup
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.autoBindDmq=true
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.provisionDurableQueue=false
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.provisionSubscriptionsToDurableQueue=false
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.useDestinationEncodingInQueueName =false
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.useGroupNameInQueueName=false
spring.cloud.stream.solace.bindings.consumeMessage-in-0.consumer.useFamiliarityInQueueName=falsec.s.s.c.s.b.p.SolaceQueueProvisioner : Creating anonymous (temporary) queue scst/18d79f9e-849a-4cbc-b4da-b75f7a498510/test.queue.dev
c.s.s.c.s.b.p.SolaceQueueProvisioner : Testing consumer flow connection to queue scst/18d79f9e-849a-4cbc-b4da-b75f7a498510/test.queue.dev (will not start it)
o.s.cloud.stream.binding.BindingService : Failed to create consumer binding; retrying in 30 secondsorg.springframework.cloud.stream.binder.BinderException: Exception thrown while starting consumer:
...
..
Caused by: com.solacesystems.jcsmp.AccessDeniedException: Permission Not Allowed0 -
I am getting the same error when trying to connect to my local Solace with preset Queue and Topic with Spring Boot application using JMS:
solace: jms: host: tcp://localhost:55555 msgVpn: myVpn clientUsername: my_client clientPassword: default #password # dynamically create the queue if the matching queue name doesn't exist in the message broker: apiProperties: Solace_JMS_DynamicDurables: true # JMS Application environment/config property: # Consume messages from a topic rather than from a queue pub-sub-domain: true
10:24:01.937 [DefaultMessageListenerContainer-11] DEBUG com.solacesystems.jms.SolSession - Client-12:jmsSession-11: Entering createConsumer(). Destination: T/myTopic messageSelector: null NoLocal: false
10:24:01.937 [DefaultMessageListenerContainer-11] DEBUG c.s.jms.SolMessageConsumer - SolMessageConsumer created. Destination: T/myTopic messageSelector: null noLocal: false state: Started durable: false
10:24:01.937 [DefaultMessageListenerContainer-11] DEBUG c.s.jms.impl.ConsumerFactory - Creating non durable consumer for topic T/myTopic endpoint: direct: false
10:24:01.941 [Context_13_ReactorThread] INFO c.s.jcsmp.impl.flow.BindRequestTask - Client-12: Got BIND ('') Error Response (403) - Permission Not Allowed
I guess I need more parameters here as mentioned in the above posts, but I cannot find any example/documentation that outlines Spring application properties suitable for Solace JMS.
show client-username my_client detail
Total Client Usernames : 5 of 102
Configured : 5
Dynamic : 0
Username : my_client
Message VPN : myVpn
Enabled : Yes
Permission Override : No
Client Profile : my_cp
ACL Profile : my_acl
Authorization Group :
Dynamically configured : No
Password Configured : Yes
Subscription Manager : No
# Clients : 1
Service SMF : 1
Service Web Transport : 0
Max Connections : 100
Service SMF : 100
Service Web Transport : 100
# Endpoints : 2
Max Endpoints : 1000
Profile Name : my_acl
Vpn Name : myVpn
Client Connect Default Action : allow
Exceptions : 0
Publish Topic Default Action : allow
Exceptions : 0
Subscribe Topic Default Action : allow
Exceptions : 0
Subscribe Share Name Default Action : allow
Exceptions : 0
0 -
Hi @azakovorotny,
Your issue will be different than the others referred to in this thread as the initial poster was using the Spring Cloud Stream binder which does NOT use JMS.
Given your error it looks like your client-username doesn't have permission to create the endpoint. Can you check your "my_cp" client-profile and see if it has "Allow Client to Create Endpoints" set to true?
If it's already set to true please go ahead and create a separate discussion in the forum to avoid confusion for others that find this thread in the future.
Hope that helps!
1 -
Thank you Marc! Fixing the profile resolved this issue.
1