Hi Everyone,
I am very new to JMS and am currently trying to get it working as my indexing backend.
We are using ActiveMQ as our JMS provider and running in a Resin 4 Server with Hibernate 3.6.3 and Hibernate Search 3.4.0.
Here is my Master Config for the search/JMS properties:
Code:
<property name="hibernate.search.default.sourceBase">/share/product/lucene/master</property>
<property name="hibernate.search.default.indexBase">/var/tmp/product/lucene/index</property>
<property name="hibernate.search.default.refresh">60</property>
<property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSMasterDirectoryProvider</property>
and here is the slave config:
Code:
<property name="hibernate.search.default.sourceBase">/share/product/lucene/master</property>
<property name="hibernate.search.default.indexBase">/var/tmp/product/lucene/index</property>
<property name="hibernate.search.default.refresh">60</property>
<property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSSlaveDirectoryProvider</property>
<property name="hibernate.search.worker.backend">jms</property>
<property name="hibernate.search.worker.jms.connection_factory">java:comp/env/jms/hibernateJms</property>
<property name="hibernate.search.worker.jms.queue">java:comp/env/jms/hibernatesearch</property>
and lastly the message driven bean for my master machine:
Code:
import cnwk.foreman.service.ProductDao;
import org.hibernate.Session;
import org.hibernate.search.backend.impl.jms.AbstractJMSHibernateSearchController;
import javax.ejb.*;
import javax.jms.MessageListener;
/**
* Created with IntelliJ IDEA. User: tunderwood Date: 12/5/12 Time: 12:27 PM To change
* this template use File | Settings | File Templates.
*/
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination",
propertyValue="java:comp/env/jms/hibernatesearch")
} )
public class MDBSearchController extends AbstractJMSHibernateSearchController
implements MessageListener {
public void setDao(final ProductDao dao) {
this.dao = dao;
}
ProductDao dao;//Spring Injected
//method retrieving the current hibernate session
protected Session getSession() {
return dao.getCurrentSession();
}
//potentially close the session opened in #getSession(), not needed here
protected void cleanSessionIfNeeded(Session session){
}
}
Currently if I update an entity from the master it updates the index and propagates out to the slaves. If I update the entity from the slave machine nothing is updated.
This leads me to believe that either my JMS queue or message driven bean is the cause but I'm not sure where to go from here.
Any advise or help is greatly appreciated.
Thanks!