libraryDependencies += "com.thing2x.smqd" %% "smqd-bridge-http" % "x.y.z"
smqd {
bridge {
drivers = [
{
name = http_br
entry.plugin = thing2x-bridge-http
config {
parallelism = 4
queue = 20
overflow-strategy = drop-buffer
bridges = [
{
topic = "sensor/+/temperature"
content-type = text/plain
method = POST # PUT, POST
prefix = http://192.168.1.100/api/receiver/
suffix = ?from=smqd-01
},
{
topic = "sensor/+/humidity"
content-type = application/octet-stream
method = POST # PUT, POST
uri = http://192.168.1.100/api/receiver/endpoint
}
]
}
}
]
}
}
-
parallelism
must be non-zero positive integer, default is 1
-
queue
size of driver's queue, default is 10
-
overflow-strategy
queue overflow strategy
- drop-head
- drop-tail
- drop-buffer (default)
- drop-new
- backpressure
- fail
-
topic
topic filter that the bridge will subscribe
-
content-type
if not specified, default is
application/octet-stream
-
method
http method, POST, PUT
-
prefix & suffix
the final http endpoint will be prefix + topic + suffix.
As example, if prefix =
http://192.168.1.100:80/api/receiver/
, suffix =?from=smq-01
, the messages published tosensor/123/temperature
will be delivered tohttp://192.168.1.100:80/api/receiver/sensor/123/temperature?from=smq-01
-
uri
if uri is defined, prefix and suffix are ignored.
all messages published to the topic will be bridged to the specified uri