Java-SDK: ReplyChannel beim Senden ohne vorhandenen Destination ReplyChannel führt zum Abbruch des Abrufs einer Submission
Zusammenfassung
Hat die Destination keinen ReplyChannel definiert führt dies beim Abruf einer Submission mit angegebenem ReplyChannel zu einem fehler bei der Validierung im Java SDK
Schritte zum Reproduzieren
- Destination ohne Reply Channel erstellen
- Senden einer Submission mit ReplyChannel
- Abrufen der Submission
Wie verhält sich der aktuelle Fehler?
Valdiderung des ReplyChannels schlägt fehl
Was ist das erwartete richtige Verhalten?
Wenn die Submission ODER die Destination keinen ReplyChannel definiert haben soll die Validierung nciht durchgeführt werden
Relevante Protokolle/Screenshots/Anfragen
//CODE FÜR DEN SENDER
var senderClient = ClientFactory.getSenderClient(config);
final SendableSubmission sendableSubmission = SendableSubmission.Builder()
.setDestination(fitconnectData.getDestinationId())
.setServiceType(fitconnectData.getServiceType(), fitconnectData.getServiceName())
.setJsonData("{ "someString" : "" + dataKey + ""}", URI.create("https://test.fitko.dev/fit-connect/schema/submission-data-schema.json"))
.addAttachments(attachments)
.setReplyChannel(ReplyChannel.fromEmail("marc.schuler@komm.one"))
.build();
try {
final SentSubmission sentSubmission = senderClient.send(sendableSubmission);
log.info("Sent submission " + sentSubmission.getSubmissionId() + " to " + sentSubmission.getDestinationId());
} catch (FitConnectSenderException e) {
e.printStackTrace();
throw new RuntimeException("Could not send submission", e);
}
// LOG SENDER
16:59:04.501 INFO d.f.fitconnect.core.SubmissionSender Sending submission e6af4025-94db-43b6-87f4-bff6aedebee1
16:59:04.672 INFO d.f.f.c.s.s.SendNewSubmissionStrategy Uploading submission took 00:171 sec
16:59:04.672 INFO d.f.f.c.s.s.SendNewSubmissionStrategy SUCCESSFULLY HANDED IN SUBMISSION !
16:59:04.673 INFO x.y.z Sent submission e6af4025-94db-43b6-87f4-bff6aedebee1 to f49820ee-e5b5-4c29-8654-995a9b51ffce
// LOG EMPFÄNGER
17:01:17.068 INFO d.f.f.core.SubmissionSubscriber Loading submission e6af4025-94db-43b6-87f4-bff6aedebee1
17:01:17.205 INFO d.f.f.c.s.SubmissionReceiver Downloading submission took 00:137 sec
17:01:17.205 INFO d.f.f.c.s.SubmissionReceiver Loading authentication tags from event log ...
17:01:17.205 INFO d.f.f.core.SubmissionSubscriber Loading authentication tags of SUBMIT event for submission e6af4025-94db-43b6-87f4-bff6aedebee1
17:01:17.529 INFO d.f.f.c.v.DefaultValidationService Validating public key without XC5 certificate chain
17:01:17.535 INFO d.f.f.c.v.DefaultValidationService Validating public key without XC5 certificate chain
17:01:17.537 INFO d.f.f.c.s.SubmissionReceiver Decrypting metadata ...
17:01:17.537 INFO d.f.f.core.SubmissionSubscriber Decrypting string
17:01:17.537 INFO d.f.f.core.crypto.JWECryptoService Currently used VM memory 127 MB
17:01:17.626 INFO d.f.f.core.crypto.JWECryptoService Decrypting 1821 bytes took 00:89 sec
17:01:17.626 INFO d.f.f.core.SubmissionSubscriber Validating metadata
17:01:17.675 ERROR x.y.z Could not get submission e6af4025-94db-43b6-87f4-bff6aedebee1
dev.fitko.fitconnect.api.exceptions.client.FitConnectSubscriberException: Submission could not be retrieved
at dev.fitko.fitconnect.client.SubscriberClient.wrapExceptions(SubscriberClient.java:140)
at dev.fitko.fitconnect.client.SubscriberClient.requestSubmission(SubscriberClient.java:91)
at […]
Caused by: java.lang.NullPointerException: Cannot invoke "dev.fitko.fitconnect.api.domain.model.replychannel.ReplyChannel.getEMail()" because "destinationReplyChannel" is null
at dev.fitko.fitconnect.core.validation.DefaultValidationService.getNonNullReplyChannelTypes(DefaultValidationService.java:462)
at dev.fitko.fitconnect.core.validation.DefaultValidationService.validateMetadata(DefaultValidationService.java:363)
at dev.fitko.fitconnect.core.SubmissionSubscriber.validateMetadata(SubmissionSubscriber.java:107)
at dev.fitko.fitconnect.client.subscriber.SubmissionReceiver.validateMetadata(SubmissionReceiver.java:122)
at dev.fitko.fitconnect.client.subscriber.SubmissionReceiver.receiveSubmission(SubmissionReceiver.java:75)
at dev.fitko.fitconnect.client.SubscriberClient.lambda$requestSubmission$1(SubscriberClient.java:91)
at dev.fitko.fitconnect.client.SubscriberClient.wrapExceptions(SubscriberClient.java:138)
... 29 common frames omitted
Wenn Sie mehrere lange Abschnitte haben, können Sie erweiterbare Details verwenden.
Erweitern für die Ausgabe langen/zusätzlichen Informationen
Akzeptanzkriterien zur Fehlerbehebung
- [ ]
- [ ]
- [ ]
Edited by Martin Vogel