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

Add new "Hono" connection type #1548

Merged
merged 77 commits into from
Dec 19, 2022

Conversation

abalarev
Copy link
Contributor

@abalarev abalarev commented Dec 9, 2022

New connection type 'hono' is introduced for user convenience. It is based on Kafka connection, but some connection properties must not to be included in the connection definition as they are automatically generated at runtime, like:

  • URI, credentials and Kafka specifics - taken from the connectivity service configuration (connectivity.conf)
  • addresses of source, target and replyTarget must be given as predefined aliases (telemetry, event, command or command_response)
  • some header mappings.
    A new piggyback command is implemented to return the "real" connection after resolving the address aliases and with included generated properties.

abalarev and others added 30 commits June 7, 2022 11:25
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…on type

Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…to feature/Hono_connection_type

# Conflicts:
#	connectivity/model/src/main/java/org/eclipse/ditto/connectivity/model/HonoAddressAlias.java
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…tion_type

# Conflicts:
#	connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/DefaultClientActorPropsFactory.java
…to feature/Hono_connection_type

# Conflicts:
#	connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/config/DefaultHonoConfig.java
#	connectivity/service/src/main/resources/connectivity.conf
* Extracted method for getting a JsonObject as a Map to improve readability.
* Also use new features of Java 17 to improve readability.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
…m value.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
* Moved interface from connectivity API to connectivity service to limit its scope.
* Moved utility method for getting URI from HonoConfig to implementing class because it is the only place where it is required now.
* Changed getter for bootstrap server URIs to actually return a set of URIs instead of a comma separated string.
* Renamed getter for credentials to state which type of credentials it returns in case there would be other credential types in future.
* Let DefaultHonoConfig base on ScopedConfig to get DittoConfigErrors in case of configuration errors.
* Added unit tests for DefaultHonoConfig.
* Refined some Javadoc comments.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
Connection enrichment extracted in a new class DefaultHonoConnectionFactory
HonoConfig cleaned up from the method getTenantId() and the parameter of getCredentials()
HonoConfig simplified - extension mechanism removed.

Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
* Renamed method `getName` to `getAliasValue` to distinct it more clearly from an enum's inherent `name` method.
* Converted methods for resolving addresses from static methods to instance methods. This makes them less error-prone because the alias value does not have to be provided. Furthermore, got rid of the boolean parameter in favour of a more expressive method name.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
* Applied clean code principles to `HonoValidator` to improve its readability.
* Made existing unit tests more comprehensive.
* Added some unit test cases.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…to feature/Hono_connection_type

# Conflicts:
#	connectivity/model/src/main/java/org/eclipse/ditto/connectivity/model/HonoAddressAlias.java
#	connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/hono/HonoConnectionFactory.java
`HonoAddressAlias` was refactored beforehand which caused the compilation errors.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
* Removed unused method `getUri`.
* Do not extend `Extension` because it really does not.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
abalarev and others added 16 commits October 21, 2022 15:20
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Silviya Georgieva-Lyoteva (IOC/PAP-DDM-RM) <Silviya.Georgieva-Lyoteva@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…tion_type

# Conflicts:
#	connectivity/model/src/main/java/org/eclipse/ditto/connectivity/model/ImmutableConnection.java
#	connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/ConnectionPersistenceActor.java
#	connectivity/service/src/test/java/org/eclipse/ditto/connectivity/service/messaging/persistence/ConnectionPersistenceActorTest.java
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
…rThrow

Signed-off-by: Silviya Georgieva-Lyoteva (IOC/PAP-DDM-RM) <Silviya.Georgieva-Lyoteva@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
Copy link
Member

@thjaeckle thjaeckle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, what a great effort, thank you @abalarev and @SilviaGeorgievaLyoteva

I did just a quick scan (and mainly on the added docs) and found some formatting issues, e.g. the {{ were not escaped at one place.
I added some (not many, I promise ;)) inline comments.

@thjaeckle thjaeckle added this to the 3.1.0 milestone Dec 9, 2022
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
@thjaeckle thjaeckle changed the title Feature/hono connection type Add new "Hono" connection type Dec 12, 2022
…tion_type

# Conflicts:
#	connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/ConnectionPersistenceActor.java
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
@abalarev abalarev requested a review from thjaeckle December 13, 2022 07:27
Copy link
Member

@thjaeckle thjaeckle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete codebase was reviewed as part of development process.

The changes I requested were all done.
So: LGTM 👍

@thjaeckle thjaeckle modified the milestones: 3.1.0, 3.2.0 Dec 13, 2022
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
@thjaeckle thjaeckle merged commit 000377a into eclipse-ditto:master Dec 19, 2022
@thjaeckle thjaeckle deleted the feature/Hono_connection_type branch December 19, 2022 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants