[hibernate-dev] HSEARCH-851 Make Avro an optional dependency, good idea?
Emmanuel Bernard
emmanuel at hibernate.org
Fri Aug 19 12:50:34 EDT 2011
There are unforeseen consequences to making Avro an optional dependency.
By doing that, I must make the SerializerProvider build process lazy or tolerant at Runtime if Avro is not here.
The problem with this approach is that if a user forgets to add Avro as a dependency, his system will fail the first time a message ought to be (de)serialized *at runtime* as opposed to fail at configuration time.
I was thinking of asking the backend if it needs a SerializationProvider and behave accordingly but it's not enough. On the receiving end, ie JMS or JGroups master, we do retrieve the index manager from the message (based on the index name) and then find the appropriate SerializationProvider. In this case the underlying backend does not need a SerializationProvider. It forces us to introduce an explicit flag to be set y the user to know whether or not the SerializationProvider is required
hibernate.search.indexname.serializer required
I find that quite error prone and am inclined to think that leaving Avro a required dependency is the less of two evils.
What do you think?
do you have an alternative approach that would work around the problem?
More information about the hibernate-dev
mailing list