Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
import org.fabric3.api.annotation.Producer;

public class BuyComponent implements BuyService {

   @Producer
   private BuyChannel buyChannel;

   public void process() {
      BuyEvent event = //...
      buyChannel.publish(event);*
   }
}

The

...

above

...

example

...

uses

...

the

...

default

...

producer

...

name

...

"buyChannel".

...

Alternatively,

...

a

...

name

...

could

...

be

...

specified

...

on

...

the

...

@

...

Producer

...

annotation.

...

The

...

next

...

excerpt

...

subscribes

...

to

...

receive

...

BuyEvents:

...

Code Block
java
java
import org.fabric3.api.annotation.Consumer;

public class BuyListener {

   @Consumer("buyChannel")*
   public void onEvent(BuyEvent event) {
      // ...
   }
}

...