Skip to content

new-counter-demo MQTT push terminates the mapper on connection failure #171

Description

@blackdragoon26

What happened:

The MQTT push method calls os.Exit(1) when the broker connection fails. Since this code runs inside the virtual protocol process, one unavailable broker terminates the whole mapper instead of allowing the process to continue and handle later device events.

What I expected to happen:

A failed MQTT connection should be logged and the current publish attempt should return without terminating the mapper process.

How to reproduce it (as minimally and precisely as possible):

  1. Configure the MQTT push method with an invalid broker address.
  2. Start the virtual protocol and publish a device value.
  3. Observe that the process exits from the push method.

A focused regression test exercises the invalid broker path and completes without process termination after the fix.

Anything else we need to know?:

The change only replaces process termination with error logging and an early return.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions