Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: EVSIM-437 add message id in request metadata #70

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class OcppSoapServerTransport private constructor(
msg.action?.lowercase() == action.lowercase()
) {
val message = ocppSoapParser.parseRequestFromSoap(msg.payload, clazz)
val response = onAction(RequestMetadata(message.messageId), message.payload)
val response = onAction(RequestMetadata(message.chargingStationId, message.messageId), message.payload)
val payload = ocppSoapParser.mapResponseToSoap(
ResponseSoapMessage(
messageId = "urn:uuid:${newMessageId()}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class WebsocketServer(
val parser = getJsonMapper(OcppVersionWamp.valueOf(ocppVersion.name))
try {
val response =
onAction(RequestMetadata(meta.ocppId), parser.parsePayloadFromJson(msg.payload, clazz))
onAction(
RequestMetadata(meta.ocppId, msg.msgId),
parser.parsePayloadFromJson(msg.payload, clazz)
)
val payload = parser.mapPayloadToString(response)
WampMessage.CallResult(msg.msgId, payload)
} catch (e: Exception) { // TODO Better mapping of exceptions https://izivia.atlassian.net/browse/IDEV-497
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.izivia.ocpp.operation.information

data class RequestMetadata(
val chargingStationId: String
val chargingStationId: String,
val messageId: String? = null
)
Loading