Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,68 @@ This project contains the SDK for the communication with the agrirouter. Everyth

The release workflow follows the https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops[Microsoft DevOps Release Model] where a release shows up as a branch in the repository.

=== Update from 1.4.x to 2.x

The update for the new release includes some breaking changes. To have a rough overview what has to be done to have the new features from 2.x in you application, please see the following migration / update guide when updating.

==== Update the Maven dependencies

The first step is to update the coordinates of the dependencies. With the release 2.x the coordinates changed to a new name and a new version.

[xml]
----
<dependency>
<groupId>com.agrirouter.api</groupId>
<artifactId>agrirouter-sdk-java-api</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.agrirouter.api</groupId>
<artifactId>agrirouter-sdk-java-impl</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.agrirouter.api</groupId>
<artifactId>agrirouter-sdk-java-convenience</artifactId>
<version>2.0.0</version>
</dependency>
----

==== Update package declarations for services and internal classes

Since the package declaration was updated along with the coordinates, there will be compiler errors that should be fixed. Some classes have moved to a more meaningful package.

image::migration_1-4_to_2-0/compiler-errors-before.png[Compiler errors before the migration.]

The new package declaration added the protocol part (`http` or in this case the `mqtt`).

image::migration_1-4_to_2-0/package-declaration-after-refactoring.png[Package declaration after migrating.]

==== Update the usage of the enums for message types

To have a better understanding about system message types and content message types, the declaration for the different types has changed. There are two new classes, the `ContentMessageType` for content messages and the `SystemMessageType` for system messages. The former technical message type will cause a compiler error, since it was replaced.

image::migration_1-4_to_2-0/former-technical-message-types.png[Former message types.]

The new declaration uses the system message type.

image::migration_1-4_to_2-0/system-message-type-afterwards.png[System message type usage afterwards.]

==== Remove former URLs for ProtoBuf message types

With the new release the URLs can be fetched from the content message types and there is no need to put them into a helper method any longer.

image::migration_1-4_to_2-0/former-content-message-type-urls.png[Former content message types.]

With the new release fetch the URLs is way more comfortable.

image::migration_1-4_to_2-0/type-urls-from-technical-message-types.png[Type URLs from content message types.]

==== Have a look at an example

The http://www.agrirouter-middleware[agrirouter middleware] has been updated after the release of version 2.x and can be an indicator regarding the workload for the migration.
Have a look at the following https://github.com/agrirouter-middleware/agrirouter-middleware/pull/12[PR #12] to see the necessary adaptions.

== Modules

=== `api` Module
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.