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

Added configuration option for auto reconnect, reconnect delay, and max inflight #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

syedmhashim
Copy link

@syedmhashim syedmhashim commented Jan 11, 2021

Purpose

Resolves Issue: Resolve Auto Reconnect in MQTT

Goals

Provide capability to configure:

  • Automatic reconnect
  • Reconnect delay
  • Max inflight

Approach

Using siddhi parameters annotation to add configurations for automatic reconnect, reconnect delay, and max inflight, as done for the rest of the configuration parameters.
The PR also includes integration tests for automatic reconnect.

User stories

NA

Release note

This release includes the adding configuration parameters for mqtt client that would allow the users to configure automatic reconnect, reconnect delay and max inflight.

Documentation

NA

Training

NA

Certification

NA

Marketing

NA

Automation tests

  • Integration tests
    • mqttPublishEventWithAutomaticReconnect
    • mqttPublishEventWithoutAutomaticReconnect
    • mqttReceiveEventsWithAutomaticReconnect
    • mqttReceiveEventsWithoutAutomaticReconnect

Security checks

Samples

Sample mqttsource siddhi script

@app:name('test')

@source(
type='mqtt',
url='tcp://localhost:1883',
topic='test/tag1',
automatic.reconnect='true',
clean.session='false'
@map(type='json'))
define stream BarStream (id string);

from BarStream#log()
select *
insert into test;

Sample mqttsink siddhi script

@app:name('test')

define trigger Mytrigger at every 5 sec;

@sink(
type='mqtt',
url='tcp://localhost:1883',
topic='test/tag1',
automatic.reconnect='true',
@map(type='json'))
define stream FooStream (id string);

from Mytrigger
select "testing..." as id
insert into FooStream;

Related PRs

NA

Migrations (if applicable)

NA

Test environment

  • JDK version: 1.8.0_231
  • Maven version: 3.5.0
  • OS: Linux
  • Architecture: x86_64
  • Cores: 4

Learning

NA

@syedmhashim syedmhashim changed the title Added configuration option for Enable autoreconnect, reconnect delay, and max inflight Added configuration option for Enable auto reconnect, reconnect delay, and max inflight Jan 11, 2021
@syedmhashim syedmhashim changed the title Added configuration option for Enable auto reconnect, reconnect delay, and max inflight Added configuration option for auto reconnect, reconnect delay, and max inflight Jan 11, 2021
@webfrank
Copy link

Hi, I've made similar changes plus re-subscribe to topic when reconnecting. Please merge this PR so I can rebase mine with resubscribe patch.

@syedmhashim
Copy link
Author

Hi, I've made similar changes plus re-subscribe to topic when reconnecting. Please merge this PR so I can rebase mine with resubscribe patch.

Hi @webfrank. I cannot merge this PR unless I have 1 approving review.

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.

2 participants