# Failed to consume a message from destination Queue

**URL:** <https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634>\
**Category:** Solace Event Broker\
**Tags:** solace-cloud, spring-cloud-stream, solace-pubsub-cache, solacepubsub\
**Created:** [April 17, 2023, 8:58am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634 "2023-04-17T08:58:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaliappans](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/kaliappans/32/1105_2.png) [@Kaliappans](https://community.solace.com/u/Kaliappans)\
**Post date:** [April 17, 2023, 8:58am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/1 "2023-04-17T08:58:37Z")

</div>

I am using Spring cloud stream 2021.0.2 to consume messages from queue, when some messages are sent , I can see the message get spooled continously in the queue but It is not coming inside application and processed because of below exception. Please help

> org.springframework.messaging.MessagingException: Incorrect type specified for header ‘deliveryAttempt’. Expected [class java.util.concurrent.atomic.AtomicInteger] but actual type is [class java.lang.String]; nested exception is java.lang.IllegalArgumentException: Incorrect type specified for header ‘deliveryAttempt’. Expected [class java.util.concurrent.atomic.AtomicInteger] but actual type is [class java.lang.String]  
> 023-04-13 16:21:39.086&nbsp;WARN 27352 — [pool-3-thread-5] s.b.i.RetryableInboundXMLMessageListener : Failed to consume a message from destination QUE\_173707\_PLATFORM\_EVENT\_LOGGING\_DEV - attempt 3  
> 2023-04-13 16:21:39.086&nbsp;WARN 27352 — [pool-3-thread-5] s.b.i.RetryableInboundXMLMessageListener : Failed to consume a message from destination QUE\_173707\_PLATFORM\_EVENT\_LOGGING\_DEV - attempt 3  
> 2023-04-13 16:21:39.086&nbsp;WARN 27352 — [pool-3-thread-5] s.b.i.RetryableInboundXMLMessageListener : Failed to consume a message from destination QUE\_173707\_PLATFORM\_EVENT\_LOGGING\_DEV - attempt 3  
> 2023-04-13 16:21:39.086&nbsp;WARN 27352 — [pool-3-thread-5] s.b.i.RetryableInboundXMLMessageListener : Failed to consume a message from destination QUE\_173707\_PLATFORM\_EVENT\_LOGGING\_DEV - attempt 3  
> 2023-04-13 16:21:39.087&nbsp;WARN 27352 — [pool-3-thread-5] s.b.i.RetryableInboundXMLMessageListener : Failed to consume a message from destination QUE\_173707\_PLATFORM\_EVENT\_LOGGING\_DEV - attempt 3  
> 2023-04-13 16:21:39.087 ERROR 27352 — [pool-3-thread-5] o.s.integration.handler.LoggingHandler&nbsp;&nbsp;: org.springframework.messaging.MessagingException: Incorrect type specified for header ‘deliveryAttempt’. Expected [class java.util.concurrent.atomic.AtomicInteger] but actual type is [class java.lang.String]; nested exception is java.lang.IllegalArgumentException: Incorrect type specified for header ‘deliveryAttempt’. Expected [class java.util.concurrent.atomic.AtomicInteger] but actual type is [class java.lang.String]

---

<div class="post-metadata">

**Author:** ![Kaliappans](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/kaliappans/32/1105_2.png) [@Kaliappans](https://community.solace.com/u/Kaliappans)\
**Post date:** [April 17, 2023, 9:00am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/2 "2023-04-17T09:00:24Z")

</div>

FYI… we are NOT setting value for ‘deliveryAttempt’ anywhere within our microservice

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 17, 2023, 9:53am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/3 "2023-04-17T09:53:24Z")

</div>

Hi @Kaliappans , that’s interesting. Looking quickly at the code for the binder (which is here: [GitHub - SolaceProducts/solace-spring-cloud: An umbrella project containing all Solace projects for Spring Cloud](https://github.com/SolaceProducts/solace-spring-cloud) ) I can see a couple references to deliveryAttempt that definitely make it look like it’s expecting an AtomicInteger. Who/what is publishing these messaages into your queue?  
Can you dump one of the messages to the console and post it here (hiding any sensitive data if necessary!). Easiest way to do this using SdkPerf, which you can download from [https://solace.com/downloads/?fwp\_downloads\_types=other](https://solace.com/downloads/?fwp_downloads_types=other) \> I’d choose Java, then just run it with something that looks like this for a basic consumer that echoes to the console:  
./sdkperf\_java.sh -cip=brokerip -cu=username@vpnname -cp=password -sql=queuename -md  
“sql” is which queue to bind to, and “md” is message dump.

 ![image.png](https://canada1.discourse-cdn.com/solace/original/1X/ffc56cb8321e7d54f05c8f0a5d7079520df156ee.png)

---

<div class="post-metadata">

**Author:** ![marc](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/marc/32/2191_2.png) [@marc](https://community.solace.com/u/marc)\
**Post date:** [April 17, 2023, 1:36pm UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/4 "2023-04-17T13:36:07Z")

</div>

Hi @Kaliappans ,  
This is essentially your Spring app saying “I am getting an invalid message per the constraints that I have set.” It expects a certain POJO but can’t convert the incoming payload into it. SO maybe your publisher and consumer are using different objects, different versions of the same object, or have different constraints?  
FYI - the Spring Cloud Stream reference guide talks about how you can add custom message converters if that is necessary: [Preface](https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/spring-cloud-stream.html#content-type-management)  
Hope that helps!

---

<div class="post-metadata">

**Author:** ![Kaliappans](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/kaliappans/32/1105_2.png) [@Kaliappans](https://community.solace.com/u/Kaliappans)\
**Post date:** [April 18, 2023, 11:35am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/5 "2023-04-18T11:35:18Z")

</div>

@Aaron I tried with SDKperf, but getting below error when executing your command. We are using truststore and keystore for authentication purpose. Should I change anything in that command ?

com.solacesystems.pubsub.sdkperf.core.PubSubException: Error while connecting.  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.pubsub.sdkperf.core.AbstractClientCollection.connect(AbstractClientCollection.java:473)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.pubsub.sdkperf.SDKPerf\_java.run(SDKPerf\_java.java:208)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.pubsub.sdkperf.SDKPerf\_java.main(SDKPerf\_java.java:119)  
Caused by: ((Client name: H17NDCFI13P0120/3676/00110001/GxGUIAu0EF&nbsp;&nbsp;Local addr: 10.8.233.95 Local port: 56369&nbsp;&nbsp;Remote addr: 10.47.158.91&nbsp;Remote port: 55555) - )&nbsp;com.solacesystems.jcsmp.JCSMPErrorResponseException: 403: Basic Authentication Is Shutdown [Subcode:58]  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.TcpChannel.executePostOnce(TcpChannel.java:235)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.ChannelOpStrategyClient.performOpen(ChannelOpStrategyClient.java:101)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.performOpenSingle(TcpClientChannel.java:428)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.access$800(TcpClientChannel.java:124)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel$ClientChannelConnect.call(TcpClientChannel.java:2610)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.open(TcpClientChannel.java:404)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.impl.JCSMPBasicSession.sniffRouter(JCSMPBasicSession.java:423)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.jcsmp.impl.JCSMPBasicSession.getMessageProducer(JCSMPBasicSession.java:772)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.pubsub.sdkperf.jcsmpcore.JcsmpClient.connect(JcsmpClient.java:1252)  
&nbsp;&nbsp;&nbsp;&nbsp;at com.solacesystems.pubsub.sdkperf.core.AbstractClientCollection.connect(AbstractClientCollection.java:471)

---

<div class="post-metadata">

**Author:** ![Kaliappans](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/kaliappans/32/1105_2.png) [@Kaliappans](https://community.solace.com/u/Kaliappans)\
**Post date:** [April 18, 2023, 1:01pm UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/6 "2023-04-18T13:01:15Z")

</div>

@Aaron@marc.dipasquale I am using Message datatype from springframwork to consume message at the receiving end. That Message class has only two fields, payload and headers. Below is the data, please let me know if anything is wrong here

Payload: {“httpResponse”:200,“responsePayload”:{“messageId”:“123456789”,“cancelCard”:[{“datastoreId”:“12533789”,“vcaId”:“111111”,“createCardRequest”:false}],“correlationId”:“1111-2222-3333-4444”}}

headers: {app\_accept-encoding=gzip, deflate, br, country=USA, req-sys-id=12533789, solace\_replyTo=#P2P/v:solace-tts1-cti-us-1u/8G29FQx5/service-name/209/00250002/xL5yCzgPq-/_, endDateTimestamp=2023-04-18\_17:59:27:748+0530, app\_connection=keep-alive, app\_channelid=Citi VCA Online, app\_user-agent=PostmanRuntime/7.28.1, target-protocol=kafka, app\_host=hostname, threadId=65, jvmId=25000, app\_postman-token=ba2a0d0c-ad6e-4d2b-b0e6-0efc77, solace\_discardIndication=false, source-type=kafka, id=84ede132-c7e1-6ac5-73c1, product-name=card, api-sys-id=ebb3-4d7b-9201-1f9a8350281c, contentType=text/plain;charset=UTF-8, listenerTopicName=citi/tts/cards/choreo/mvca/datastore/v1/resp/cancelvca, order=null, App\_ServiceFlowCount=5, solace\_scst\_messageVersion=1, solace\_expiration=0, deliveryAttempt=1, solace\_replicationGroupMessageId=rmid1:0a57b-5a7f5257557-00000000-f02ba02c, startDateTimestamp=2023-04-18\_17:59:27:743+0530, versionDetails={“description”:“description”,“tag”:“tag”,“version”:“0.0.0”}, listenerQueueName=DEV-QUEUE, solace\_receiveTimestamp=0, timeDuration=5, stacktrace=, app\_accept=/, region=NAM, status=SUCCESS, publishTopicName=#P2P/v:solace-tts1-cti-us-1u/8G29FQx5/service-name/209/00250002/xL5yCzgPq-/_, solace\_destination=topic-name, app\_content-length=210, app\_api-req-id=123456789, App\_OriginalRequestPayload={“messageId”:“123456789”,“correlationId”:“ebb3-4d7b-9201”,“clientId”:“TestClient”,“cardNetworkType”:“Backend”,“region”:“NAM”,“country”:“USA”,“getCardImage”:false,“requestType”:“CANCEL”,“channelId”:“Online”,“citiScreeningRequired”:false,“createCardRequest”:false,“errorMessage”:,“cancelCard”:[{“datastoreId”:“0123a”,“vcaId”:“123456”,“createCardRequest”:false,“errorMessage”:}],“validationSuccess”:true}, skip-input-type-conversion=false, app\_content-type=application/json, sourceHost=H17NFNFT13P0394, solace\_dmqEligible=true, solace\_priority=4, solace\_correlationId=0b309a51-ebb3-4d7b-9201-1f9a8350281c, applicationName=Test-app, exceptionMessage=, timestamp=1681820967744, solace\_timeToLive=0, x-citiportal-apim-client-id=mVCA\_Test, binderName=choreography, acknowledgmentCallback=com.solace.spring.cloud.stream.binder.util.JCSMPAcknowledgementCallbackFactory$JCSMPAcknowledgementCallback@414f6f6, environment=local, Backend={}, singularityheader=appId=1303_ctrlguid=1681618009_acctguid=3d227243-46a9-4474-bc47-0ab43e91e045_ts=1681820967755_btname=MessageHandler.handleMessage_btcomp=2465728_bttype=POJO_bttypestr=POJO_mctype=auto_mcvalue=guid=439d96bb-31a9-483b-b35f-cb976fc730dfexitguid=23_unresolvedexitid=8921447_cidfrom=2465728_etypeorder=CUSTOM_esubtype=CUSTOM_cidto={[UNRESOLVED][8921447]}\*donotresolve=true, solace\_redelivered=false}

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 19, 2023, 4:38am UTC](https://community.solace.com/t/failed-to-consume-a-message-from-destination-queue/1634/7 "2023-04-19T04:38:26Z")

</div>

Hi @Kaliappans . For SdkPerf with truststore, please see this recent thread: [How to use SDKPerf tool for connecting to VPN using certificate authentication — Solace Community](https://community.solace.com/discussion/comment/5902#Comment_5902)  
In your list of headers, I can see deliveryAttempt \> :  
solace\_scst\_messageVersion=1,

> solace\_expiration=0,  
> deliveryAttempt=1,  
> solace\_replicationGroupMessageId=rmid1:0a57b-5a7f5257557-00000000-f02ba02c,  
> startDateTimestamp=2023-04-18\_17:59:27:743+0530,  
> However I still can’t tell if it’s a string or int since nothing is quoted.  
> Who / what kind of app is publishing this data?  
> It would still be very helpful if you can get an SdkPerf dump of the message contents.
