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

Protocol Gateway Template: close connections to AMQP adapter if no device is connected #5

Open
b-abel opened this issue Jul 7, 2020 · 1 comment

Comments

@b-abel
Copy link
Contributor

b-abel commented Jul 7, 2020

Currently, the protocol gateway template opens one AMPQ connection to Hono for each tenant that has devices connected to it. When the last device connection for a tenant is closed it would be good to close the corresponding AMQP connection as well.

@calohmn
Copy link
Contributor

calohmn commented Jul 22, 2020

As part of working on the connection handling here, it would be good to also consider using a timeout for the handleEndpointConnection() request triggering the initial connection establishment to the AMQP adapter for a tenant. The result of factory.connect could be decoupled from the connectGatewayToAmqpAdapter return value here, using an isConnected(timeout) check for the return value instead.

@b-abel b-abel changed the title Protocol Gatewy Template: close connections to AMQP adapter if no device is connected Protocol Gateway Template: close connections to AMQP adapter if no device is connected Aug 4, 2020
b-abel added a commit to bosch-io/hono-extras that referenced this issue Aug 5, 2020
…ted.

The MQTT endpoints are tracked for each tenant. When the last endpoint of a tenant is
closed, the AMQP connection for this tenant is closed as well.

Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
b-abel added a commit to bosch-io/hono-extras that referenced this issue Aug 24, 2020
Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
b-abel added a commit to bosch-io/hono-extras that referenced this issue Aug 24, 2020
…aders + static imports).

Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
b-abel added a commit to bosch-io/hono-extras that referenced this issue Aug 24, 2020
MultiTenantConnectionManager.addEndpoint() and MultiTenantConnectionManager.closeEndpoint()
now return a future instead of throwing exceptions.

Closing TenantConnections no longer throws an exception if the instance is already closed.

Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
b-abel added a commit to bosch-io/hono-extras that referenced this issue Sep 10, 2020
Some minor changes like log statements and JavaDoc.
+ Refactoring of some methods in TenantConnections to return futures to indicate success or failure.

Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
calohmn pushed a commit that referenced this issue Sep 11, 2020
The MQTT endpoints are tracked for each tenant. When the last endpoint of a tenant is
closed, the AMQP connection for this tenant is closed as well.

Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
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

No branches or pull requests

2 participants