Things-client 3.2

Micro release, binary compatible to things-client 3.2.0.

Bug Fixes

Fix failing reconnection when Bosch IoT Things backend is not available for > 5 seconds.

Minor release, binary compatible to things-client 3.1.0 and 3.0.0 respectively.

Highlights

  • Exists allows to define conditional requests.
  • Options enable developers to specify the messages or events the client is interested in - thus let the service filter out the “noise”.

Enhancements

  • New exists option
    This option can be used on put and set methods on a Thing and sub-elements, such as Features.
    The option can be specified by means of the factory method Options.Modify#exists(boolean).
  • New put methods for Thing:
    • CommonThingIntegration#put(Thing,Option…) and
    • CommonThingIntegration#put (JsonObject,Option…).
      These methods
      • create the Thing if it does not exist or
      • overwrite the Thing if it already exists.
        The behavior can be influenced by specifying the exists-option (Options.Modify#exists(boolean)).
  • Enhanced implementation of CommonThingIntegration#update(): one round-trip to the server
    The previous implementation needed two.
  • New options for filtering events and messages from a subscriber's perspective
    When starting to consume via CommonThingIntegration#startConsumption(Option<?>…) you can define:
    • Options.Consumption#namespaces(CharSequence…) to specify for which namespaces the consumption should receive events / messages
    • Options.Consumption#filter(CharSequence) to specify additional RQL expression for filtering.
      Such RQL expressions are evaluated in the backend, thus the client will only will get the events matching the expression.

Examples

Conditional create and update

Create a thing only if it does not exist

thingIntegration.put(thing, Options.Modify.exists(false))

Update a feature only if it already exists:

twin.putFeature(feature, Options.Modify.exists(true))

Event filtering via options

The client will only receive twin events for things from namespace com.bosch.namespace1, in which an attribute counter was changed to a value greater than 42.

client.twin().startConsumption(
        Options.Consumption.namespaces("com.bosch.namespace1"),
        Options.Consumption.filter("gt(attributes/counter,42)")
).get();