Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic message payload is in byte for websocket sink #142

Open
NguyenAntoine opened this issue Jan 26, 2021 · 0 comments
Open

Generic message payload is in byte for websocket sink #142

NguyenAntoine opened this issue Jan 26, 2021 · 0 comments

Comments

@NguyenAntoine
Copy link

Hello,

I've tried the new applications maven in 3.0.0 for rabbitmq in sping data cloud v2.7.
I followed the example in the README of the websocket sink.

But when I'm showing the log messages. I got the payload messages in bytes (and not in String) like this :

2021-01-26 09:41:48.147 TRACE 1420 --- [est.time.test-1] s.c.f.c.w.WebsocketConsumerConfiguration : Handling message: GenericMessage [payload=byte[17], headers={amqp_receivedDeliveryMode=PERSISTENT, amqp_receivedExchange=test.time, amqp_deliveryTag=1, deliveryAttempt=1, amqp_consumerQueue=test.time.test, amqp_redelivered=false, amqp_receivedRoutingKey=test.time, amqp_timestamp=Tue Jan 26 09:41:48 GMT 2021, amqp_messageId=e093b293-5926-7cc3-c19f-215b57458084, id=8444e817-646a-ecfa-c28b-b61f0903ba14, amqp_consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, sourceData=(Body:'01/26/21 09:41:48' MessageProperties [headers={}, timestamp=Tue Jan 26 09:41:48 GMT 2021, messageId=e093b293-5926-7cc3-c19f-215b57458084, contentType=application/json, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=0, redelivered=false, receivedExchange=test.time, receivedRoutingKey=test.time, deliveryTag=1, consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, consumerQueue=test.time.test]), contentType=application/json, timestamp=1611654108134}]
2021-01-26 09:41:49.110 TRACE 1420 --- [est.time.test-1] s.c.f.c.w.WebsocketConsumerConfiguration : Handling message: GenericMessage [payload=byte[17], headers={amqp_receivedDeliveryMode=PERSISTENT, amqp_receivedExchange=test.time, amqp_deliveryTag=2, deliveryAttempt=1, amqp_consumerQueue=test.time.test, amqp_redelivered=false, amqp_receivedRoutingKey=test.time, amqp_timestamp=Tue Jan 26 09:41:49 GMT 2021, amqp_messageId=17567485-a344-30f0-1cbd-b907784ff32e, id=b9318b3b-c174-e711-5e51-95751b1e30ae, amqp_consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, sourceData=(Body:'01/26/21 09:41:49' MessageProperties [headers={}, timestamp=Tue Jan 26 09:41:49 GMT 2021, messageId=17567485-a344-30f0-1cbd-b907784ff32e, contentType=application/json, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=0, redelivered=false, receivedExchange=test.time, receivedRoutingKey=test.time, deliveryTag=2, consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, consumerQueue=test.time.test]), contentType=application/json, timestamp=1611654109108}]
2021-01-26 09:41:50.119 TRACE 1420 --- [est.time.test-1] s.c.f.c.w.WebsocketConsumerConfiguration : Handling message: GenericMessage [payload=byte[17], headers={amqp_receivedDeliveryMode=PERSISTENT, amqp_receivedExchange=test.time, amqp_deliveryTag=3, deliveryAttempt=1, amqp_consumerQueue=test.time.test, amqp_redelivered=false, amqp_receivedRoutingKey=test.time, amqp_timestamp=Tue Jan 26 09:41:50 GMT 2021, amqp_messageId=a1c2a06b-fbc9-2c60-d7e7-fe709cbeb9ca, id=37f7613d-6508-18f0-5372-4b924841049d, amqp_consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, sourceData=(Body:'01/26/21 09:41:50' MessageProperties [headers={}, timestamp=Tue Jan 26 09:41:50 GMT 2021, messageId=a1c2a06b-fbc9-2c60-d7e7-fe709cbeb9ca, contentType=application/json, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=0, redelivered=false, receivedExchange=test.time, receivedRoutingKey=test.time, deliveryTag=3, consumerTag=amq.ctag-Qaw3YfzzQjTm9_KKJOwBQA, consumerQueue=test.time.test]), contentType=application/json, timestamp=1611654110118}]

I think the problem might be in the pom.xml with some function definition missing (or maybe its on purpose).
When I check the other sink pom.xml like the log-sink, I see a function definition in the configuration :

<name>log</name>
<type>sink</type>
<version>${project.version}</version>
<configClass>org.springframework.cloud.fn.consumer.log.LogConsumerConfiguration.class</configClass>
<functionDefinition>byteArrayTextToString|logConsumer</functionDefinition>

Could I have some help with this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant