Skip to content

Creating a Remote Job does not trigger a NextNotification

0

Hello, I am developing a Greengrass component responsible for handling remote jobs following this guide. When the components starts it successfully retrieves a pending job using the get mqtt topic, however when I update its status to Succeded I don't receive a notification in the $aws/things/MyThing/jobs/notify-next topic even though I am correctly subscribed.

I tried subscribing using the Messaging test client on the Thing from the LocalDebugConsole component and the problem persists, however when the MQTT test client directly from the AWS dashboard the messages arrive correctly (both on the notify and notify-next topics)

asked a year ago172 views

2 Answers
0
Accepted Answer

For future reference, looks like the policy should be attached directly to the thing instead of a thing group in order to receive notify-next updates.

answered a year ago

EXPERT

reviewed a year ago

0

When working with AWS IoT Jobs, there are specific conditions under which notifications are published to the jobs/notify and jobs/notify-next topics.

Based on your description, there are a few potential reasons why you're not receiving a notification on the $aws/things/MyThing/jobs/notify-next topic:

  1. The notify-next topic only receives a message when the status of the first job execution in the list changes. If you're updating a job to "Succeeded" but it wasn't the next job in the queue (or if there are no other jobs in the queue), you won't receive a notification on the notify-next topic.

  2. When a job completes (status changes to "Succeeded"), a notification is published to the jobs/notify topic, but a notification is only published to the jobs/notify-next topic if the next job in the queue has changed as a result.

  3. If the queue is empty after your job completes, a NextNotification should be published to the jobs/notify-next topic with an empty message.

Since you mentioned that you can see the messages when using the MQTT test client from the AWS dashboard but not from the LocalDebugConsole component, this suggests a potential issue with your Greengrass component's subscription or message handling:

  • Verify that your Greengrass component has the correct permissions to subscribe to these topics
  • Check that you're using QoS level 1 for your subscriptions
  • Ensure that your component is correctly processing the messages it receives

Also, note that response messages from the AWS IoT Jobs service don't pass through the message broker and can't be subscribed to by other clients or rules. To receive job activity-related messages, you need to use the notify and notify-next topics and ensure that jobs events are enabled.
Sources
Jobs notifications - AWS IoT Core
Jobs events - AWS IoT Core
AWS IoT Device Not Starting Remote Job | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.