Skip to content

AWS IoT Device SDK for Java v2: problems following tutorial on Publish/subscribe local messages #474

Answered by MikeDombo
marcellorinaldo asked this question in Q&A
Discussion options

You must be logged in to vote

Please use the default builder for the client, you should not set any of those options yourself. GreengrassCoreIPCClientV2.builder().build().

You're using MessageContext which is only used when receiving messages, not when sending messages. The documentation notes "AWS IoT Greengrass Core software sets this context object in messages when you subscribe, and ignores this context object in messages that you publish."

You need to specify the topic to send to in the publish request, not in the message context.

Fully worked examples are provided in the documentation: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-publish-subscribe.html#ipc-operation-publishtotopic:~:text=in%20its…

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
13 replies
@MikeDombo
Comment options

@marcellorinaldo
Comment options

@MikeDombo
Comment options

@marcellorinaldo
Comment options

@MikeDombo
Comment options

Answer selected by MikeDombo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants