SDK Libraries
A service handler implements io.pocat.platform.service.Servit and is packaged in services/<service>/libs.
Servit
import io.pocat.platform.service.Servit;
import io.pocat.platform.service.ServitConfig;
import io.pocat.platform.service.ServitMessage;
import io.pocat.platform.service.ServitException;
public class AcceptPaymentServit implements Servit {
public void init(ServitConfig config) { }
public void handle(ServitMessage message) throws ServitException { }
public void destroy() { }
}
The next step is ServitMessageChannel.publish. service.xml names the class in <type>. Gateway route filters are a separate extension and are not how a Servit is written.
Errors
A failure the Servit cannot finish throws ServitException with an ErrorCode. Business outcomes, such as a declined payment, are ordinary messages on an outbound channel. Unhandled errors follow the deploy <dead-letter-channel>.
Source repository
SDK modules and sample code are in the dongobisoft/pocat-gateway repository.
