<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic event listeners in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/event-listeners/m-p/315491#M2492</link>
    <description>&lt;P&gt;Hi community.&lt;/P&gt;
&lt;P&gt;I am trying to create an event listener, so far, I just want to log a message when my listener is called. See my class below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.event.EventBundle;
import org.nuxeo.ecm.core.event.PostCommitEventListener;

public class EventForwarder implements PostCommitEventListener{

	private static final Log log = LogFactory.getLog(EventForwarder.class);

	public void handleEvent(EventBundle arg0) {
		log.warn("===========New Event=========");
	}
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I  added  &lt;CODE&gt;listener-contrib.xml&lt;/CODE&gt;  file(see below) in &lt;CODE&gt;NUXEO_HOME/nxserver/config&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="event-forwarder" version="1.0"&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.core.event.EventServiceComponent"
             point="listener"&amp;gt;
    &amp;lt;listener name="rabbitMQ" async="true" priority="666" postCommit="true"
              class="{my-package}.EventForwarder"&amp;gt;
      &amp;lt;event&amp;gt;documentCreated&amp;lt;/event&amp;gt;
    &amp;lt;/listener&amp;gt;
  &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also added the jar containing my class in &lt;CODE&gt;NUXEO_HOME/nxserver/bundles&lt;/CODE&gt; directory. After restarting nuxeo and creating a couple of documents from the UI, I do not see the line I am writing in the logs.
Is there anything I am missing to register the listener?&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2017 15:05:07 GMT</pubDate>
    <dc:creator>Rodney_Ledo</dc:creator>
    <dc:date>2017-04-06T15:05:07Z</dc:date>
    <item>
      <title>event listeners</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/event-listeners/m-p/315491#M2492</link>
      <description>&lt;P&gt;Hi community.&lt;/P&gt;
&lt;P&gt;I am trying to create an event listener, so far, I just want to log a message when my listener is called. See my class below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.event.EventBundle;
import org.nuxeo.ecm.core.event.PostCommitEventListener;

public class EventForwarder implements PostCommitEventListener{

	private static final Log log = LogFactory.getLog(EventForwarder.class);

	public void handleEvent(EventBundle arg0) {
		log.warn("===========New Event=========");
	}
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I  added  &lt;CODE&gt;listener-contrib.xml&lt;/CODE&gt;  file(see below) in &lt;CODE&gt;NUXEO_HOME/nxserver/config&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="event-forwarder" version="1.0"&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.core.event.EventServiceComponent"
             point="listener"&amp;gt;
    &amp;lt;listener name="rabbitMQ" async="true" priority="666" postCommit="true"
              class="{my-package}.EventForwarder"&amp;gt;
      &amp;lt;event&amp;gt;documentCreated&amp;lt;/event&amp;gt;
    &amp;lt;/listener&amp;gt;
  &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also added the jar containing my class in &lt;CODE&gt;NUXEO_HOME/nxserver/bundles&lt;/CODE&gt; directory. After restarting nuxeo and creating a couple of documents from the UI, I do not see the line I am writing in the logs.
Is there anything I am missing to register the listener?&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 15:05:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/event-listeners/m-p/315491#M2492</guid>
      <dc:creator>Rodney_Ledo</dc:creator>
      <dc:date>2017-04-06T15:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: event listeners</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/event-listeners/m-p/315492#M2493</link>
      <description>&lt;P&gt;First uncomment this part in &lt;CODE&gt;lib/log4j.xml&lt;/CODE&gt; and find out if your component is really seen and loaded&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 11:40:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/event-listeners/m-p/315492#M2493</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2017-04-07T11:40:33Z</dc:date>
    </item>
  </channel>
</rss>

