You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2023/02/27 01:18:40 UTC

[GitHub] [rocketmq] yuluo-yx created a discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

GitHub user yuluo-yx created a discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

github repository : https://github.com/waylau/spring-cloud-stream-tutorial/tree/main/samples/spring-cloud-stream-batch-demo
```
2023-02-24 12:53:04.290 ERROR 13984 --- [chDestination_1] o.s.integration.handler.LoggingHandler   : org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.cloud.stream.function.FunctionConfiguration$FunctionToDestinationBinder$1@78cc5885]; nested exception is com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}, failedMessage=GenericMessage [payload=byte[20], headers={ROCKET_MQ_BORN_TIMESTAMP=1677127641153, ROCKET_MQ_FLAG=0, ROCKET_MQ_MESSAGE_ID=7F00000125FC27C170F0740A70410003, ROCKET_MQ_TOPIC=logBatchDestination, ROCKET_MQ_BORN_HOST=172.29.16.1, id=c7330354-35ec-f97c-4c3a-2ec798fbccfa, ROCKET_MQ_SYS_FLAG=0, contentType=application/json, ROCKET_MQ_QUEUE_ID=0, target-protocol=kafka, timestamp=1677214381277}]
	at org.springframework.integration.support.utils.IntegrationUtils.wrapInHandlingExceptionIfNecessary(IntegrationUtils.java:191)
	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:65)
	at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133)
	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:106)
	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:72)
	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:317)
	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:272)
	at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)
	at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166)
	at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47)
	at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)
	at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:216)
	at com.alibaba.cloud.stream.binder.rocketmq.integration.inbound.RocketMQInboundChannelAdapter.lambda$consumeMessage$6(RocketMQInboundChannelAdapter.java:163)
	at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
	at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:225)
	at com.alibaba.cloud.stream.binder.rocketmq.integration.inbound.RocketMQInboundChannelAdapter.consumeMessage(RocketMQInboundChannelAdapter.java:162)
	at com.alibaba.cloud.stream.binder.rocketmq.integration.inbound.RocketMQInboundChannelAdapter.lambda$onInit$5(RocketMQInboundChannelAdapter.java:124)
	at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:402)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}
	at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:721)
	at com.alibaba.fastjson.serializer.CollectionCodec.deserialze(CollectionCodec.java:126)
	at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:688)
	at com.alibaba.fastjson.JSON.parseObject(JSON.java:396)
	at com.alibaba.fastjson.JSON.parseObject(JSON.java:461)
	at com.alibaba.fastjson.JSON.parseObject(JSON.java:429)
	at com.alibaba.fastjson.support.spring.messaging.MappingFastJsonMessageConverter.convertFromInternal(MappingFastJsonMessageConverter.java:69)
	at org.springframework.messaging.converter.AbstractMessageConverter.fromMessage(AbstractMessageConverter.java:185)
	at org.springframework.cloud.function.context.config.SmartCompositeMessageConverter.fromMessage(SmartCompositeMessageConverter.java:115)
	at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.convertInputMessageIfNecessary(SimpleFunctionRegistry.java:1328)
	at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.convertInputIfNecessary(SimpleFunctionRegistry.java:1089)
	at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.doApply(SimpleFunctionRegistry.java:734)
	at org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry$FunctionInvocationWrapper.apply(SimpleFunctionRegistry.java:589)
	at org.springframework.cloud.stream.function.PartitionAwareFunctionWrapper.apply(PartitionAwareFunctionWrapper.java:84)
	at org.springframework.cloud.stream.function.FunctionConfiguration$FunctionWrapper.apply(FunctionConfiguration.java:791)
	at org.springframework.cloud.stream.function.FunctionConfiguration$FunctionToDestinationBinder$1.handleMessageInternal(FunctionConfiguration.java:623)
	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:56)
	... 22 more

```

GitHub link: https://github.com/apache/rocketmq/discussions/6191

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@rocketmq.apache.org


[GitHub] [rocketmq] yuluo-yx added a comment to the discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

Posted by GitBox <gi...@apache.org>.
GitHub user yuluo-yx added a comment to the discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

Any Idea?

GitHub link: https://github.com/apache/rocketmq/discussions/6191#discussioncomment-5117253

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@rocketmq.apache.org


[GitHub] [rocketmq] Oliverwqcwrw added a comment to the discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

Posted by GitBox <gi...@apache.org>.
GitHub user Oliverwqcwrw added a comment to the discussion: com.alibaba.fastjson.JSONException: expect '[', but {, pos 1, line 1, column 2{"name":"Sam Spade"}

Thank you for providing the demo. I noticed that you are using rocketmq integrated by spring-cloud-alibaba. You can raise an issue in the spring-cloud-alibaba community  [spring-cloud-alibaba](https://github.com/alibaba/spring-cloud-alibaba/issues)

GitHub link: https://github.com/apache/rocketmq/discussions/6191#discussioncomment-5118914

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@rocketmq.apache.org