title: Events containing Consumer are ignored
body: <p>I have been trying to recreate Adam Bein's video <a href="http://www.adam-bien.com/roller/abien/entry/java_ee_7_completablefuture_clean" rel="nofollow noreferrer">Going Asynchronous with CompleteableFuture and JavaEE 7</a>), essentially it's firing an event containing a Consumer and observing it in another class.
  In the video he is using the &quot;LambdaFish&quot; application server, I couldn't find any other references to this so I tried running the code with WAS Liberty, Glassfish 4 and Wildfly. All produced the same result, i.e. no Consumer event was observed. I tried various other classes in my test case and all worked perfectly, only Consumer appears to demonstrate the problem.</p>
  <p>I haven't found a suitable way to trace what is going on &quot;under the covers&quot;, my hope was to trace a working and non working event and see where we go &quot;off the rails&quot;.</p>
  <p>This is a simple problem to recreate using the following code :-</p>
  <p><strong>Producer</strong></p>
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.util.function.Consumer;
  import javax.ejb.LocalBean;
  import javax.ejb.Stateless;
  import javax.enterprise.event.Event;
  import javax.inject.Inject;
  
  @Stateless
  @LocalBean
  public class Producer {
      @Inject Event&lt;Consumer&lt;String&gt;&gt; ce;
      @Inject Event&lt;List&lt;Object&gt;&gt; oe;
      
      public void produce() {
          Consumer&lt;String&gt; c = (x) -&gt; System.out.println(x.toLowerCase());
          ArrayList&lt;Object&gt; al = new ArrayList&lt;Object&gt;();
          System.out.println(&quot;Firing Events&quot;);
          ce.fire(c);
          oe.fire(al);
          System.out.println(&quot;Events fired&quot;);
      }
  }
  </code></pre>
  <p><strong>Observer</strong></p>
  <pre><code>package event.controller;
  
  
  import java.util.ArrayList;
  import java.util.function.Consumer;
  import javax.ejb.Singleton;
  import javax.ejb.Startup;
  import javax.enterprise.event.Observes;
  
  @Singleton
  @Startup
  public class Observer {
      
      public void onStuff(@Observes Consumer&lt;String&gt; cs) {
          System.out.println(&quot;consumer event triggered&quot;);
          cs.accept(&quot;Hi There&quot;);
      }
      
      public void onStuff2(@Observes ArrayList&lt;Object&gt; al) {
          System.out.println(&quot;ArrayList event triggered&quot;);
      }
  }
  </code></pre>
  <p>This is just one of many permutations and combinations I have tried; all with no success. I also tried setting up Glassfish tracing as described in this article <a href="https://glassfish.java.net/wiki-archive/Detailed%20Logging%20Output%20with%20GlassFish%20Server,%20Hibernate,%20and%20Log4j.html" rel="nofollow noreferrer">Glassfish Tracing with log4j</a>, the article seems out of date. I wasn't able to start Glassfish under eclipse using the plugin, when I tried to define a server I got an &quot;internal error&quot;.</p>
  <p>I also tried the WAS Liberty CDI tracing using <em>=info:JCDI=all:com.ibm.ws.webbeans</em>=all:org.apache.webbeans*=all:org.jboss.weld*=all:com.ibm.ws.cdi*=all:EJBContainer=all:MetaData=all:Injection=all</p>
  <p>but there were no trace events triggered during the event.fire().</p>
  <p>Is there something fundamentally wrong with what I am doing?</p>
  <p>Has anyone managed to fire an event containing a Consumer and observe it successfully?</p>
  <p>Does anyone know of any trace tools that can be used to determine why one case works and the other does not?</p>
  <p>Thanks in advance for any comments and/or suggestions.</p>