I am trying to implement custom record format (other than JSON) for publishing a message to a Kafka topic. Based on my understanding, an external jar needs to be developed that implements pegaserde interface with serialize() method implemented to return the byte stream in the required message format. To develop this external jar, some more JARs are needed. Some of these dependent JARs are already present in Pega (like prpublic.jar, pricu2jdk.jar) while some are not. My questions are -
1) Can the external JAR that is being developed be directly placed in the lib folder? Or does it have to be imported to the Db via Application -> Distribution -> Import wizard?
2) Does this external JAR also needs to bundle the already present Pega JARs (prpublic.jar etc.) or can that be skipped?
3) Do other dependent JARs which are not already in Pega - do these also need to be imported to Db or can we just place these in the lib folder?
4) Is there any difference in Pega's behavior between the other external JARs and the ones that implement pegaserde? I understand the pegaserde JAR has to have the codeset name and version as default.
We are trying to keep the size of the JAR to the minimum and therefore want to understand how to package these external JARs in the most efficient and correct way.
Importing external jars into Pega can be tricky as you have already realized. The most common issue is the potential class conflict. The rule of thumb is that if the dependent classes are already in the OOTB pega jars, you should not include those jars. As already described in the document, try to make sure your custom jars are in the same codeset that can be switch on/off through DASS if there are some issues. If possible, can you share your list of jars? We can review and provide more concrete suggestions. Placing jars into the tomcat /lib can work as well although hard to manage across multiple nodes (the actual details can be different pending on what app server platform you are running).