Package io.micronaut.rabbitmq.annotation
Annotation Interface RabbitProperty
@Documented
@Retention(RUNTIME)
@Target({PARAMETER,TYPE,METHOD})
@Repeatable(RabbitProperties.class)
@Bindable
@Inherited
public @interface RabbitProperty
Used to set properties while publishing or bind to properties while consuming.
For example while producing messages, the annotation can be set at the method
or class level to provide static data. It can be applied at the parameter level
to set the property differently per execution.
While consuming the annotation can be applied to a parameter to bind the
property to the argument. In addition, it may also be used to supply any arguments
to the broker.
- Since:
- 1.1.0
- Author:
- James Kleeh
- See Also:
-
BasicProperties
-
Optional Element Summary
-
Element Details
-
value
String valueIf used as a bound parameter, this is the property name. If used on a class level this is value and not the property name.- Returns:
- The name of the property, otherwise it is inferred from the
name()
- Default:
- ""
-
name
String nameNever used if applied to a parameter. Supplies the property name if used on a class or method.- Returns:
- The name of property
- Default:
- ""
-
type
Class typeOnly to be used when defining consumer arguments to convert the value to the required type by RabbitMQ.- Returns:
- The type to convert the value to
- Default:
- java.lang.Void.class
-