io.smallrye.reactive.messaging.annotations.Channel Maven / Gradle / Ivy
package io.smallrye.reactive.messaging.annotations;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
/**
* This qualifier indicates which channel should be injected / populated.
*
* This qualifier can be used to inject a Channel containing the items and signals propagated by the specified
* channel. For example, it can be used to {@code @Inject} a {@code Publisher} representing a channel managed by the
* Reactive Messaging implementation.
*
* Can be injected:
*
* - Publisher<X> with X the payload type
* - Publisher<Message<X>> with X the payload type
* - Flowable<X> with X the payload type
* - Flowable<Message<X>> with X the payload type
* - PublisherBuilder<Message<X>> with X the payload type
* - PublisherBuilder<X> with X the payload type
*
*
* When this qualifier is used on an {@link Emitter}, it indicates which channel received the emitted values / signals:
*
*
*
* @Inject @Channel("my-channel") Emitter<String> emitter;
*
* // ...
* emitter.send("a");
*
*
*
* @deprecated Use {@link org.eclipse.microprofile.reactive.messaging.Channel} instead.
*/
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ METHOD, CONSTRUCTOR, FIELD, PARAMETER })
@Deprecated
public @interface Channel {
/**
* The name of the channel.
*
* @return the channel name, mandatory, non-null and non-blank. It must matches one of the available channels.
*/
@Nonbinding
String value();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy