Package io.micronaut.mqtt.bind.impl
Class AcknowledgeMqttBinder
java.lang.Object
io.micronaut.mqtt.bind.impl.AcknowledgeMqttBinder
- All Implemented Interfaces:
MqttBinder<MqttBindingContext<?>,
,io.micronaut.messaging.Acknowledgement> TypedMqttBinder<MqttBindingContext<?>,
io.micronaut.messaging.Acknowledgement>
@Singleton
public class AcknowledgeMqttBinder
extends Object
implements TypedMqttBinder<MqttBindingContext<?>,io.micronaut.messaging.Acknowledgement>
A typed binder for
Acknowledgement
that allows subscribers to manually
acknowledge messages. An Acknowledgement
must be an argument to subscriber methods
and used when manual acknowledgements is set to true in the configuration.- Since:
- 1.0.0
- Author:
- James Kleeh
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionOptional<io.micronaut.messaging.Acknowledgement>
bindFrom
(MqttBindingContext<?> context, io.micronaut.core.convert.ArgumentConversionContext<io.micronaut.messaging.Acknowledgement> conversionContext) Binds the given context and returns an optional value.void
bindTo
(MqttBindingContext<?> context, io.micronaut.messaging.Acknowledgement value, io.micronaut.core.type.Argument<io.micronaut.messaging.Acknowledgement> argument) Binds the given value to the given context.io.micronaut.core.type.Argument<io.micronaut.messaging.Acknowledgement>
-
Constructor Details
-
AcknowledgeMqttBinder
public AcknowledgeMqttBinder()
-
-
Method Details
-
getArgumentType
public io.micronaut.core.type.Argument<io.micronaut.messaging.Acknowledgement> getArgumentType()- Specified by:
getArgumentType
in interfaceTypedMqttBinder<MqttBindingContext<?>,
io.micronaut.messaging.Acknowledgement>
-
bindTo
public void bindTo(MqttBindingContext<?> context, io.micronaut.messaging.Acknowledgement value, io.micronaut.core.type.Argument<io.micronaut.messaging.Acknowledgement> argument) Description copied from interface:MqttBinder
Binds the given value to the given context. Publisher method arguments will be passed to this method.- Specified by:
bindTo
in interfaceMqttBinder<MqttBindingContext<?>,
io.micronaut.messaging.Acknowledgement> - Parameters:
context
- The message contextvalue
- The argument valueargument
- The publisher argument
-
bindFrom
public Optional<io.micronaut.messaging.Acknowledgement> bindFrom(MqttBindingContext<?> context, io.micronaut.core.convert.ArgumentConversionContext<io.micronaut.messaging.Acknowledgement> conversionContext) Description copied from interface:MqttBinder
Binds the given context and returns an optional value. Subscriber method arguments will be passed to this method.- Specified by:
bindFrom
in interfaceMqttBinder<MqttBindingContext<?>,
io.micronaut.messaging.Acknowledgement> - Parameters:
context
- The method contextconversionContext
- The argument conversion context- Returns:
- An optional value
-