-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Search JMS Index Updates Not Propagating Properly
PostPosted: Fri Dec 14, 2012 7:43 pm 
Newbie

Joined: Mon Nov 26, 2012 2:34 pm
Posts: 6
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!


Top
 Profile  
 
 Post subject: Re: Hibernate Search JMS Index Updates Not Propagating Properly
PostPosted: Sun Dec 16, 2012 6:59 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
it would be a good start to enable the log levels on the master to see if it receives events when the slaves make any updates which should trigger indexing.
That will provide much more useful information, to know in which area to look for the problem as it likely is configuration / server related.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.