We upgraded to 4.1.1 and want to now start using jms master/slave because of nfs issues in a clustered environment. Using tomcat 6 with activemq. Running into this issues where all of a sudden the indexes don't update on the master - no errors, nothing. I can reproduce it everytime if I run the mass indexter from a slave. Within about 10 minutes or so I can see the indexes aren't being updated. Below is config for master and slave...
//master
Code:
<entry key="hibernate.search.default.sourceBase" value="${searchMaster.baseDir}" />
<entry key="hibernate.search.default.indexBase" value="${searchIndexes.baseDir}" />
<entry key="hibernate.search.default.refresh" value="300" />
<entry key="hibernate.search.default.optimizer.operation_limit.max" value="2000" />
<entry key="hibernate.search.default.exclusive_index_use" value="true" />
//slave
<entry key="hibernate.search.default.directory_provider" value="${searchDirectoryProvider}" />
<entry key="hibernate.search.default.sourceBase" value="${searchMaster.baseDir}" />
<entry key="hibernate.search.default.indexBase" value="${searchIndexes.baseDir}" />
<entry key="hibernate.search.default.refresh" value="300" />
<entry key="hibernate.search.default.optimizer.operation_limit.max" value="2000" />
<entry key="hibernate.search.default.exclusive_index_use" value="true" />
<entry key="hibernate.search.default.worker.backend" value="jms" />
<entry key="hibernate.search.default.worker.jms.connection_factory" value="java:comp/env/jms/ConnectionFactory" />
<entry key="hibernate.search.default.worker.jms.queue" value="java:comp/env/jms/queue/hibernatesearch" />
//master controller
Code:
public class HibernateSearchController extends AbstractJMSHibernateSearchController implements MessageListener {
// method retrieving the appropriate session
protected Session getSession() {
EntityManager em = null;
try {
em = getEm();
} catch (InterruptedException e) {
e.printStackTrace();
}
return (Session) em.getDelegate();
}
private EntityManager getEm() throws InterruptedException {
EntityManager em = AbstractPersistentEntity.getEm();
if (em == null) {
Thread.sleep(60000);
em = getEm();
}
return em;
}
// potentially close the session opened in #getSession(), not needed here
protected void cleanSessionIfNeeded(Session session) {
}
public void register() {
try {
System.out.println("registering " + getClass().getName());
Context initCtx;
initCtx = new InitialContext();
ConnectionFactory connectionFactory = (ConnectionFactory) initCtx.lookup("java:comp/env/jms/ConnectionFactory");
Connection connection = connectionFactory.createConnection();
connection.start();
javax.jms.Session session = connection.createSession(true, 0);
// Look up for destination and set listner
Queue queue = (Queue) initCtx.lookup("java:comp/env/jms/queue/hibernatesearch");
MessageConsumer consumer = session.createConsumer(queue);
consumer.setMessageListener(this);
System.out.println("done registering " + getClass().getName());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void onMessage(Message message) {
//System.out.println("recieved message");
super.onMessage(message);
}
}
Are there any other debugging options other than just turning on debug for org.hibernate.search?