Skip to content

Lazy AMQP connection and forwarding error logging#5889

Open
mutasimissa wants to merge 1 commit into
traccar:masterfrom
mutasimissa:feat/amqp-lazy-connection
Open

Lazy AMQP connection and forwarding error logging#5889
mutasimissa wants to merge 1 commit into
traccar:masterfrom
mutasimissa:feat/amqp-lazy-connection

Conversation

@mutasimissa

Copy link
Copy Markdown
Contributor

AMQP is the only forwarder that connects synchronously in its constructor. If the broker is unavailable, factory.newConnection() throws and the RuntimeException propagates through Guice provisioning, causing System.exit(1) — Traccar fails to start entirely.

Kafka, MQTT and JSON forwarders don't have this issue because they connect lazily or asynchronously.

This change defers the AMQP connection to the first publishMessage() call and adds channel.isOpen() checks so forwarding resumes automatically if the broker restarts. Follows the same lazy-connect pattern used in NetworkForwarder.

Also adds LOGGER.warn to EventForwarderAmqp and PositionForwarderAmqp for forwarding errors, matching existing logging in NetworkForwarder and PositionForwardingHandler.

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

Successfully merging this pull request may close these issues.

1 participant