This sample demonstrates how to implement a custom post-processor for the Java RESTful Engine. The processor removes the data from the document, so when you get the document after processing, the "Data" will be an empty byte array.
- Java 8 or higher
- The Java RESTful Engine (Tomcat or Docker installation)
- Maven (for building the sample)
- Navigate to the
CustomProcessingSampleJavadirectory. - Add the Java RESTful Engine SDK JARs to your classpath (or as Maven dependencies if available).
- Build the project using Maven:
This will create a JAR file in the
mvn clean package
targetdirectory.
- Copy the compiled
CustomProcessor.class(or JAR) to theliborclassesdirectory of your RESTful Engine Tomcat installation. - Edit the
application.properties(or equivalent config) for the RESTful Engine and add:postProcessor=com.example.customprocessing.CustomProcessor - Restart Tomcat.
- Build your custom processor into a JAR file.
- Create a Dockerfile that extends the official Java RESTful Engine image and copies your JAR into the appropriate directory.
Example Dockerfile:
FROM apryse/fluent-restful-engine-java:latest COPY target/CustomProcessingSampleJava.jar /opt/restfulengine/lib/ ENV POST_PROCESSOR=com.example.customprocessing.CustomProcessor
- Build and run your Docker image:
docker build -t custom-restful-engine . docker run -p 8080:8080 custom-restful-engine
Start your RESTful Engine and run a report. The returned document's "Data" will be empty.
See the official documentation for more details.