Show Table of Contents
12.20. Tips for Using a Reader
- Reader instances are never used concurrently. Smooks Core will create a new instance for every message, or, will pool and reuse instances as per the
readerPoolSizeFilterSettingsproperty. - If your Reader requires access to the Smooks
ExecutionContextfor the current filtering context, your Reader needs to implement theorg.milyn.xml.SmooksXMLReaderinterface. - If your Source data is a binary data stream your Reader must implement the
org.milyn.delivery.StreamReaderinterface. - You can configure your reader within your source code (e.g. in your unit tests) using a
GenericReaderConfiguratorinstance, which you then set on theSmooksinstance. - While the basic <reader> configuration is fine, it is possible to define a custom configuration namespace (XSD) for your custom CSV Reader implementation. This topic is not covered here. Review the source code to see the extended configuration namespace for the Reader implementations supplied with Smooks, e.g. the
EDIReader,CSVReader,JSONReaderetc. From this, you should be able to work out how to do this for your own custom Reader.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.