FlowId not matching with incoming message and silent ignoring.

hirenhcm
hirenhcm Member Posts: 2

Facing an issue with connecting to my OnPrem Solace server. The same issue is not seen on my local Solace using docker.

I have created a Simple Spring Boot Application that produces a message on a topic and consumes the same. I am using the below version to achieve this.

JDK 17
spring-boot-starter-parent: 3.2.5
spring-cloud-starter-stream-solace: 5.1.0 also tried 5.0.0
spring-cloud-stream: 4.1.0 also tried 4.0.0

When enabling debug logs I see that the messages are getting read by the consumer that are pending on the queue. But are getting skipped or silently ignored as per the below logs.

When Spring Boot starts up it creates the below logs and registers the below flowId.

20:30:47.077 [Context_2_ReactorThread] DEBUG c.s.jcsmp.impl.RequestResponseTask , - RequestResponseTask ([BRT resource=APPS.INTERNAL.COUCHBASE.V1 existingFH=null flowType=CONSUMER_REDELIVERY_FLOW counter=1]) cancelTimer 
20:30:47.077 [Context_2_ReactorThread] DEBUG c.s.j.impl.timers.SubAckTimedTask , - Creating SubAckTimedTask.
20:30:47.077 [Context_2_ReactorThread] DEBUG c.s.jcsmp.impl.flow.FlowHandleImpl , - Flow 0: Clear AD timer
20:30:47.077 [Context_2_ReactorThread] DEBUG c.s.jcsmp.impl.flow.BindRequestTask , - Client-1: Got OK bindresponse, flowName=null, flowId=3208652207, QueueAccessType=NON_EXCLUSIVE, explicitlyActive=false
20:30:47.077 [Context_2_ReactorThread] DEBUG c.s.j.impl.flow.SubFlowManagerImpl , - Client-1: regActiveFlow id=3208652207
20:30:47.078 [Context_2_ReactorThread] DEBUG c.s.j.impl.flow.SubFlowManagerImpl , - Client-1: addManagedFlow Flowid=3208652207
20:30:47.078 [restartedMain] DEBUG c.s.jcsmp.impl.flow.FlowHandleImpl , - Client-1:SubFlow-3208652207: Flow 3208652207: getWindowSize()=255

When a message is already in the queue or a new message reaches the queue we see the below logs getting printed.

12:47:07.995 [Context_2_ReactorThread] DEBUG c.s.jcsmp.protocol.impl.SmfUhUtil , - Ignored one or more unknown parameters in SMF header.
12:47:07.995 [Context_2_ReactorThread] DEBUG c.s.j.impl.flow.SubFlowManagerImpl , - Client-1: Demux pub msg:com.solacesystems.jcsmp.impl.JCSMPGenericXMLMessage[messageId=15,ackMessageId=25429524241,prevId=14,CID_count=0,userData=,type=PERSISTENT,priority=4,redelivered=false,timeToLive=0,expiration=0,dmqEligible=true,topicSeqNum=null,metadataLen=0,contentLen=0,attLen=33,sendAttemptedOnce=false,ackImmediately=false,safeToRelease=false,retransmitting=false,sendCount=0@550307b0]
12:47:07.995 [Context_2_ReactorThread] DEBUG c.s.j.impl.flow.SubFlowManagerImpl , - Client-1: Received incoming message with no active flow found for flowId=-1086231418, ignoring.

Looking at the flowId it is a negative ID and does not match the flow ID that is generated at the start when Spring Boot starts up.

I have also identified the issue why the flowId does not match when a message reaches the consumer. This issue lies under sol-jcsmp-10.22.0.jar(This is a jar is been decompiled and debugged.)

Here we see as issue in com.solacesystems.jcsmp.protocol.smf.impl.SMFHeaderDecoder.class. Here the flowId generated is a Long but getting converted to a int which is a out of range if the number is generated is large i.e Client-1: regActiveFlow id=3208652207

h.setPm_ad_flowid((int)TlvParameterParser.getSmfAssuredFlowId(parambuf, off));

Additionally, the setPm_ad_flowid is also an int in the class com.solacesystems.jcsmp.protocol.smf.SMFHeaderBean.

Looking at this it clearly shows as a bug.

However, I do not have a workaround for this and am exploring options to downgrade but this will also require me to downgrade my spring version.

Request the team to fix this or give me an alternate workaround to resolve this.

Tagged:

Comments

  • Sreekanth
    Sreekanth Member Posts: 13 ✭✭

    Is it resolved? I am also facing similar issue

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 538 admin

    Hey @Sreekanth and @hirenhcm - sol-jcsmp-10.24.1 is released and has this fix! You can check the release notes here and can see the fix under SOL-120798

    Please give it a try and let us know if you still see the same behaviour.

  • Sreekanth
    Sreekanth Member Posts: 13 ✭✭
    edited July 8 #4

    @Tamimi Thanks but how do we get this? would you give a release for New java API with this new jcsmp library version? Or Do we need to override in our application?

  • hirenhcm
    hirenhcm Member Posts: 2

    @Tamimi - I have verified sol-jcsmp-10.24.1 by excluding the version from spring-cloud-starter-stream-solacejar.

    <dependency>
    <groupId>com.solace.spring.cloud</groupId>
    <artifactId>spring-cloud-starter-stream-solace</artifactId>

    <exclusions>
    <exclusion>
    <!-- Excluding sol-jcsmp jar to use the fix -->
    <groupId>com.solacesystems</groupId>
    <artifactId>sol-jcsmp</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>com.solacesystems</groupId>
    <artifactId>sol-jcsmp</artifactId>
    <version>10.24.1</version>
    </dependency>

    This is now working as expected.

    Thanks

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 538 admin

    Hey @Sreekanth - you will sumply just need to update the version of the Java API you are using