Sepa CT Extension Point Client
Sepa CT Extension Point Client consists of Receive Connector with kafka/jms transports to consume ExtensionPointRequest messages published by Sepa CT CSM Service and a Send Connector to send ExtensionPointResponse. Client will also deal with low level stuff, such as constructing entire scheme ISO message for which client can implement appropriate handler.
Configuration
Property Grouping: ipf.csm.sepa-ct.extension-point
| Key | Description | Default Value |
|---|---|---|
ipf.csm.sepa-ct.extension-point.enabled |
When enabled, ExtensionPointRequest messages will be processed and ExtensionPointResponse will be sent. |
|
Kafka Client Dependency
<dependency>
<groupId>com.iconsolutions.ipf.payments.csm.sepact</groupId>
<artifactId>sepact-csm-extension-point-client-kafka</artifactId>
</dependency>
Property Grouping: ipf.csm.sepa-ct.extension-point.kafka
| Key | Description | Default Value |
|---|---|---|
ipf.csm.sepa-ct.extension-point.kafka.consumer.kafka-clients.group.id |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-restarts-within |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-backoff |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.min-backoff |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.min-backoff |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.topic |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-restarts-within |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-restarts |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-backoff |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.random-factor |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.kafka-clients.client.id |
|
|
ipf.csm.sepa-ct.extension-point.kafka.consumer.topic |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-restarts |
|
|
ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.random-factor |
|
Jms Client Dependency
<dependency>
<groupId>com.iconsolutions.ipf.payments.csm.sepact</groupId>
<artifactId>sepact-csm-extension-point-client-jms</artifactId>
</dependency>
Property Grouping: ipf.csm.sepa-ct.extension-point.jms
| Key | Description | Default Value |
|---|---|---|
ipf.csm.sepa-ct.extension-point.jms.consumer-window-size |
|
|
ipf.csm.sepa-ct.extension-point.jms.failover-timeout |
|
|
ipf.csm.sepa-ct.extension-point.jms.request.queue |
Queue to receive ExtensionPointRequest |
|
ipf.csm.sepa-ct.extension-point.jms.response.queue |
Queue to send ExtensionPointResponse |
|
How To Use
Add either Kafka or Jms sepact-csm-extension-point-client dependency and ipf-component-store-mongo to your IPF Application.
<dependency>
<groupId>com.iconsolutions.ipf.componentstore</groupId>
<artifactId>ipf-component-store-mongo</artifactId>
</dependency>
Validating Messages
The Extension Point Client will construct java object representation of ISO message from ExtensionPointRequest and child components which are stored in ipf-component-store and forward it to MessageHandler implementation. In case MessageHandler is not defined for specific ISO message, client will always respond with ACCEPT outcome.
In case you want to validate a pacs.008 message, you need create a class which implements MessageHandler interface and define it as spring bean.
public interface MessageHandler<T> {
CompletionStage<Outcome> handleMessage(ProcessingContext processingContext, T message);
Class<T> forType();
Direction forDirection();
@Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
class Outcome {
private final ExtensionPointOutcome outcome;
private final String rejectionReason;
public static Outcome accept() {
return new Outcome(ExtensionPointOutcome.ACCEPT, null);
}
public static Outcome reject(String rejectionReason) {
return new Outcome(ExtensionPointOutcome.REJECT, rejectionReason);
}
}
}
Example class which will validate NbOfTxs and TtlIntrBkSttlmAmt in Pacs.008 GroupHeader:
@Component
public class Pacs008FromSchemeMessageHandler implements MessageHandler<SCTFIToFICustomerCreditTransferV08> {
@Override
public CompletionStage<Outcome> handleMessage(ProcessingContext processingContext, SCTFIToFICustomerCreditTransferV08 message) {
BigDecimal ttlAmount = message.getGrpHdr().getTtlIntrBkSttlmAmt().getValue();
BigDecimal transactionAmountsSum = message.getCdtTrfTxInves().stream()
.map(transaction -> transaction.getIntrBkSttlmAmt().getValue())
.reduce(BigDecimal.ZERO, BigDecimal::add);
if (Integer.getInteger(message.getGrpHdr().getNbOfTxs()).equals(message.getCdtTrfTxInves().size())
&& ttlAmount.compareTo(transactionAmountsSum) == 0) {
return CompletableFuture.completedStage(Outcome.accept());
} else {
return CompletableFuture.completedStage(Outcome.reject("IntrBkSttlmAmt doesn't match"));
}
}
@Override
public Class<SCTFIToFICustomerCreditTransferV08> forType() {
return SCTFIToFICustomerCreditTransferV08.class;
}
@Override
public Direction forDirection() {
Direction.FROM_SCHEME;
}
}
ISO Message types for which handlers can be defined:
ISO Message |
Java Class |
Supported Direction |
Pacs.002 |
sepa.ct.iso.std.iso._20022.tech.xsd.pacs_002_001_10S2.SCTFIToFIPaymentStatusReportV10 |
FROM_SCHEME |
Pacs.004 |
sepa.ct.iso.std.iso._20022.tech.xsd.pacs_004_001_009.SCTPaymentReturnV09 |
TO_SCHEME/FROM_SCHEME |
Pacs.008 |
sepa.ct.iso.std.iso._20022.tech.xsd.pacs_008_001_008.SCTFIToFICustomerCreditTransferV08 |
TO_SCHEME/FROM_SCHEME |
Pacs.028 |
sepa.ct.iso.std.iso._20022.tech.xsd.pacs_028_001_003.SCTFIToFIPaymentStatusRequestV03 |
FROM_SCHEME |
Camt.027 |
sepa.ct.iso.std.iso._20022.tech.xsd.camt_027_001_007.SCTClaimNonReceiptV07 |
FROM_SCHEME |
Camt.029 |
sepa.ct.iso.std.iso._20022.tech.xsd.camt_029_001_009.SCTResolutionOfInvestigationV09 |
TO_SCHEME/FROM_SCHEME |
Camt.056 |
sepa.ct.iso.std.iso._20022.tech.xsd.camt_056_001_008.SCTFIToFIPaymentCancellationRequestV08 |
TO_SCHEME/FROM_SCHEME |
Camt.087 |
sepa.ct.iso.std.iso._20022.tech.xsd.camt_087_001_006.SCTRequestToModifyPaymentV06 |
FROM_SCHEME |