diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7b9556..2f7011a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,32 @@ on: [push, pull_request, workflow_dispatch] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" + # This workflow contains multiple jobs + # this job sets up the oldest version of go to check lang compatibility + CompatibilityCheck: + runs-on: ubuntu-20.04 + #Steps for the compatiblity test + steps: + - uses: actions/checkout@v2 + - name: Setup Go Environment + uses: actions/setup-go@v4 + with: + go-version: '1.17.0' + - name: Check Go Version + run: go version + - name: Compiles + run: go build ./... + - name: Runs unit tests + if: ${{ success() }} + run: go test -coverprofile ./unitcoverage.out ./... + - name: Uploads artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + path: | + ./unitcoverage.out + + # this job runs linux based tests Linux: # The type of runner that the job will run on runs-on: ubuntu-20.04 @@ -17,7 +42,10 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: '1.20' + go-version: '1.21' + check-latest: true + - name: Check Go Version + run: go version - name: Compiles run: go build ./... diff --git a/Jenkinsfile b/Jenkinsfile index 7964fde..9f49f44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,28 @@ currentBuild.rawBuild.getParent().setQuietPeriod(0) library 'jenkins-pipeline-library@main' -stage('Build') { - builder.goapi() -} +/* + Go Version examples: + auto-v1.17.x: Latest patch of 1.17 release + auto-v1.17.2: Specific patch of 1.17 release + auto-v1.17.0: First release of 1.17 (Despite go versioning this as 1.17) + auto-latest: Most recent patch version of latest minor release + auto-previous: Most recent patch version of previous minor release + auto-2previous: Most recent patch version of second last minor release + + Adoption of new versions into these may be delayed. +*/ + +builder.goapi([ + "buildCheckGoVer": 'auto-v1.17.x', + "validationGoVer": 'auto-v1.17.x', + "getTestPermutations": { + List> permutations = [] + for (platform in [builder.LINUX_ARM, builder.LINUX_X86_64, builder.LINUX_MUSL, builder.DARWIN_X86_64, builder.DARWIN_ARM]) { + for (gover in ['auto-latest', 'auto-previous']) { + permutations << [platform, gover] + } + } + return permutations + } +]) diff --git a/NOTICE.txt b/NOTICE.txt index c2a0278..e62d14c 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,6 +1,6 @@ pubsubplus-go-client -Copyright 2021-2023 Solace Corporation. All rights reserved. +Copyright 2021-2024 Solace Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 37cd1bc..075bf20 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,4 @@ https://solace.com/support - The [Solace Developer Portal](https://dev.solace.com) - Understanding [Solace technology](https://solace.com/products/tech/) -Copyright 2021-2023 Solace Corporation. All rights reserved. +Copyright 2021-2024 Solace Corporation. All rights reserved. diff --git a/doc.go b/doc.go index b503841..ff59cb9 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_callbacks.c b/internal/ccsmp/ccsmp_callbacks.c index 727a5b6..a293443 100644 --- a/internal/ccsmp/ccsmp_callbacks.c +++ b/internal/ccsmp/ccsmp_callbacks.c @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_container.go b/internal/ccsmp/ccsmp_container.go index 852739b..7cd272d 100644 --- a/internal/ccsmp/ccsmp_container.go +++ b/internal/ccsmp/ccsmp_container.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_core.go b/internal/ccsmp/ccsmp_core.go index 060ddb9..62a6bb1 100644 --- a/internal/ccsmp/ccsmp_core.go +++ b/internal/ccsmp/ccsmp_core.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_endpoint_prop_generated.go b/internal/ccsmp/ccsmp_endpoint_prop_generated.go index e42ba0b..9a6e9de 100644 --- a/internal/ccsmp/ccsmp_endpoint_prop_generated.go +++ b/internal/ccsmp/ccsmp_endpoint_prop_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_flow.go b/internal/ccsmp/ccsmp_flow.go index bde0615..ddf8ff0 100644 --- a/internal/ccsmp/ccsmp_flow.go +++ b/internal/ccsmp/ccsmp_flow.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_flow_event_generated.go b/internal/ccsmp/ccsmp_flow_event_generated.go index 31e5ae8..1abc3ed 100644 --- a/internal/ccsmp/ccsmp_flow_event_generated.go +++ b/internal/ccsmp/ccsmp_flow_event_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_flow_prop_generated.go b/internal/ccsmp/ccsmp_flow_prop_generated.go index 7322a54..6138c35 100644 --- a/internal/ccsmp/ccsmp_flow_prop_generated.go +++ b/internal/ccsmp/ccsmp_flow_prop_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,6 +66,10 @@ const ( SolClientFlowPropMaxReconnectTries = C.SOLCLIENT_FLOW_PROP_MAX_RECONNECT_TRIES // SolClientFlowPropReconnectRetryIntervalMs: When a flow is reconnecting, the API will attempt to reconnect immediately, if that bind attempt fails it will wait for the retry interval before attempting to connect again. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_RECONNECT_RETRY_INTERVAL_MS SolClientFlowPropReconnectRetryIntervalMs = C.SOLCLIENT_FLOW_PROP_RECONNECT_RETRY_INTERVAL_MS + // SolClientFlowPropRequiredOutcomeFailed: Create a flow that allows solClient_flow_settleMsg() with SOLCLIENT_OUTCOME_FAILED. Ignored on transacted sessions. Requires SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_FAILED + SolClientFlowPropRequiredOutcomeFailed = C.SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_FAILED + // SolClientFlowPropRequiredOutcomeRejected: Create a flow that allows solClient_flow_settleMsg() with SOLCLIENT_OUTCOME_REJECTED. Ignored on transacted sessions. Requires SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_REJECTED + SolClientFlowPropRequiredOutcomeRejected = C.SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_REJECTED // SolClientFlowPropDefaultBindTimeoutMs: The default bind timeout in milliseconds. SolClientFlowPropDefaultBindTimeoutMs = C.SOLCLIENT_FLOW_PROP_DEFAULT_BIND_TIMEOUT_MS // SolClientFlowPropDefaultWindowsize: The default Flow window size. diff --git a/internal/ccsmp/ccsmp_generate.go b/internal/ccsmp/ccsmp_generate.go index f47752b..e7ee77c 100644 --- a/internal/ccsmp/ccsmp_generate.go +++ b/internal/ccsmp/ccsmp_generate.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_global_prop_generated.go b/internal/ccsmp/ccsmp_global_prop_generated.go index 2c89bfe..f8180c4 100644 --- a/internal/ccsmp/ccsmp_global_prop_generated.go +++ b/internal/ccsmp/ccsmp_global_prop_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_helper.c b/internal/ccsmp/ccsmp_helper.c index 2c80293..ab58951 100644 --- a/internal/ccsmp/ccsmp_helper.c +++ b/internal/ccsmp/ccsmp_helper.c @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_helper.h b/internal/ccsmp/ccsmp_helper.h index 0b30a0f..9412a96 100644 --- a/internal/ccsmp/ccsmp_helper.h +++ b/internal/ccsmp/ccsmp_helper.h @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,4 +49,4 @@ typedef struct solClient_errorInfo_wrapper void * uintptr_to_void_p(solClient_uint64_t ptr); -#endif \ No newline at end of file +#endif diff --git a/internal/ccsmp/ccsmp_log_level_generated.go b/internal/ccsmp/ccsmp_log_level_generated.go index b154d7e..a8f65af 100644 --- a/internal/ccsmp/ccsmp_log_level_generated.go +++ b/internal/ccsmp/ccsmp_log_level_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_message.go b/internal/ccsmp/ccsmp_message.go index 446f55d..61dd6e8 100644 --- a/internal/ccsmp/ccsmp_message.go +++ b/internal/ccsmp/ccsmp_message.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -538,8 +538,8 @@ func SolClientMessageSetTimeToLive(messageP SolClientMessagePt, timeToLive int64 // Utility functions -const defaultMsgDumpBufferSize = 1000 -const msgDumpMultiplier = 5 +// Set the default message dump buffer size to accommodate +// the Distributed Tracing properties in the message dump, SOL-107974 const maxDumpSize = 10000 // SolClientMessageDump function @@ -587,11 +587,9 @@ func SolClientMessageDump(messageP SolClientMessagePt) string { } } - bufferSize := C.ulong(defaultMsgDumpBufferSize + payloadSize*msgDumpMultiplier) // Truncate the message after 10,000 characters, SOL-62945 - if bufferSize > maxDumpSize { - bufferSize = maxDumpSize - } + // removed the dynamic calculation of buffer size as defaultMsgDumpBufferSize{1000} + (payloadSize * msgDumpMultiplier{5}) + bufferSize := C.ulong(maxDumpSize) buffer := (*C.char)(C.malloc(bufferSize)) defer C.free(unsafe.Pointer(buffer)) diff --git a/internal/ccsmp/ccsmp_message_tracing.go b/internal/ccsmp/ccsmp_message_tracing.go new file mode 100644 index 0000000..e4a732e --- /dev/null +++ b/internal/ccsmp/ccsmp_message_tracing.go @@ -0,0 +1,352 @@ +// pubsubplus-go-client +// +// Copyright 2021-2024 Solace Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ccsmp + +/* +#include +#include + +#include "solclient/solClient.h" +#include "solclient/solClientMsg.h" +#include "solclient/solClientMsgTracingSupport.h" +*/ +import "C" +import ( + "fmt" + "unsafe" + + "solace.dev/go/messaging/internal/impl/logging" +) + +// Reexport of various CCSMP types + +// SolClientMessageTracingContextType is assigned a value +type SolClientMessageTracingContextType = C.solClient_msg_tracing_context_type_t + +// SolClientMessageTracingInjectionStandardType is assigned a value +type SolClientMessageTracingInjectionStandardType = C.solClient_msg_tracing_injection_standard_type_t + +// SolClientContextTypeTransportContext is assigned a value +const SolClientContextTypeTransportContext = C.TRANSPORT_CONTEXT + +// SolClientContextTypeCreationContext is assigned a value +const SolClientContextTypeCreationContext = C.CREATION_CONTEXT + +// SolClientMessageTracingInjectionStandardTypeSMF is assigned a value +const SolClientMessageTracingInjectionStandardTypeSMF = C.SOLCLIENT_INJECTION_STANDARD_SMF + +// SolClientMessageTracingInjectionStandardTypeW3C is assigned a value +const SolClientMessageTracingInjectionStandardTypeW3C = C.SOLCLIENT_INJECTION_STANDARD_W3C + +// TODO the calls to handleCcsmpError are slow since they lock the thread. +// Ideally, we wrap these calls in C such that the golang scheduler cannot +// interrupt us, and then there is no need to lock the thread. This should +// be done for all datapath functionality, ie. the contents of this file. + +// Distributed tracing properties + +// SolClientMessageGetTraceContextTraceID function +func SolClientMessageGetTraceContextTraceID(messageP SolClientMessagePt, contextType SolClientMessageTracingContextType) ([16]byte, *SolClientErrorInfoWrapper) { + // to hold the traceID property + var cChar C.solClient_uint8_t + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_getTraceIdByte(messageP, contextType, &cChar, C.size_t(16)) + }) + if errorInfo != nil { + if errorInfo.ReturnCode == SolClientReturnCodeFail { + logging.Default.Warning( + fmt.Sprintf( + "Encountered error fetching Creation context traceID prop: %s, subcode: %d", + errorInfo.GetMessageAsString(), + errorInfo.SubCode)) + } + return [16]byte{}, errorInfo + } + + traceID := *(*[16]byte)(unsafe.Pointer(&cChar)) + return traceID, errorInfo +} + +// SolClientMessageSetTraceContextTraceID function +func SolClientMessageSetTraceContextTraceID(messageP SolClientMessagePt, traceID [16]byte, contextType SolClientMessageTracingContextType) *SolClientErrorInfoWrapper { + if len(traceID) > 0 { + cTraceID := (*C.solClient_uint8_t)(C.CBytes(traceID[:])) + + defer C.free(unsafe.Pointer(cTraceID)) // free the pointer after function executes + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_setTraceIdByte(messageP, contextType, cTraceID, C.size_t(len(traceID))) + }) + return errorInfo + } + return nil +} + +// SolClientMessageGetTraceContextSpanID function +func SolClientMessageGetTraceContextSpanID(messageP SolClientMessagePt, contextType SolClientMessageTracingContextType) ([8]byte, *SolClientErrorInfoWrapper) { + // to hold the spanID property + var cChar C.solClient_uint8_t + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_getSpanIdByte(messageP, contextType, &cChar, C.size_t(8)) + }) + if errorInfo != nil { + if errorInfo.ReturnCode == SolClientReturnCodeFail { + logging.Default.Warning( + fmt.Sprintf( + "Encountered error fetching Creation context spanID prop: %s, subcode: %d", + errorInfo.GetMessageAsString(), + errorInfo.SubCode)) + } + return [8]byte{}, errorInfo + } + + spanID := *(*[8]byte)(unsafe.Pointer(&cChar)) + return spanID, errorInfo +} + +// SolClientMessageSetTraceContextSpanID function +func SolClientMessageSetTraceContextSpanID(messageP SolClientMessagePt, spanID [8]byte, contextType SolClientMessageTracingContextType) *SolClientErrorInfoWrapper { + if len(spanID) > 0 { + cSpanID := (*C.solClient_uint8_t)(C.CBytes(spanID[:])) + + defer C.free(unsafe.Pointer(cSpanID)) // free the pointer after function executes + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_setSpanIdByte(messageP, contextType, cSpanID, C.size_t(len(spanID))) + }) + return errorInfo + } + return nil +} + +// SolClientMessageGetTraceContextSampled function +func SolClientMessageGetTraceContextSampled(messageP SolClientMessagePt, contextType SolClientMessageTracingContextType) (bool, *SolClientErrorInfoWrapper) { + // to hold the Sampled property + var cSampled C.solClient_bool_t + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_isSampled(messageP, contextType, &cSampled) + }) + if errorInfo != nil { + if errorInfo.ReturnCode == SolClientReturnCodeFail { + logging.Default.Warning( + fmt.Sprintf( + "Encountered error fetching Creation context sampled prop: %s, subcode: %d", + errorInfo.GetMessageAsString(), + errorInfo.SubCode)) + } + return false, errorInfo + } + + isSampled := *(*bool)(unsafe.Pointer(&cSampled)) + return isSampled, errorInfo +} + +// SolClientMessageSetTraceContextSampled function +func SolClientMessageSetTraceContextSampled(messageP SolClientMessagePt, sampled bool, contextType SolClientMessageTracingContextType) *SolClientErrorInfoWrapper { + var isSampled C.solClient_bool_t = 0 + if sampled { + isSampled = 1 + } + return handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_setSampled(messageP, contextType, isSampled) + }) +} + +// SolClientMessageGetTraceContextTraceState function +func SolClientMessageGetTraceContextTraceState(messageP SolClientMessagePt, contextType SolClientMessageTracingContextType) (string, *SolClientErrorInfoWrapper) { + // to hold the trace state + var traceStateChar *C.char + var traceStateSize C.size_t + defer C.free(unsafe.Pointer(traceStateChar)) + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_getTraceStatePtr(messageP, contextType, &traceStateChar, &traceStateSize) + }) + + if errorInfo != nil { + if errorInfo.ReturnCode == SolClientReturnCodeFail { + logging.Default.Warning( + fmt.Sprintf( + "Encountered error fetching Creation contex traceState prop: %s, subcode: %d", + errorInfo.GetMessageAsString(), + errorInfo.SubCode)) + } + return "", errorInfo + } + + return C.GoStringN(traceStateChar, C.int(traceStateSize)), errorInfo +} + +// SolClientMessageSetTraceContextTraceState function +func SolClientMessageSetTraceContextTraceState(messageP SolClientMessagePt, traceState string, contextType SolClientMessageTracingContextType) *SolClientErrorInfoWrapper { + cStr := C.CString(traceState) + // use the length of the traceState string not len(traceState) + 1 + traceStateLen := len(traceState) + defer C.free(unsafe.Pointer(cStr)) // free the pointer after function executes + + errorInfo := handleCcsmpError(func() SolClientReturnCode { + // trace state is not null terminal in SMF protocol + // write only char bytes not including null terminal, so use the length of the traceState string not len(traceState) + 1 + return C.solClient_msg_tracing_setTraceStatePtr(messageP, contextType, cStr, C.ulong(traceStateLen)) + }) + return errorInfo +} + +// For the Creation Context + +// SolClientMessageGetCreationTraceContextTraceID function +func SolClientMessageGetCreationTraceContextTraceID(messageP SolClientMessagePt) ([16]byte, *SolClientErrorInfoWrapper) { + // return the traceID property for the creation trace context + return SolClientMessageGetTraceContextTraceID(messageP, SolClientContextTypeCreationContext) +} + +// SolClientMessageSetCreationTraceContextTraceID function +func SolClientMessageSetCreationTraceContextTraceID(messageP SolClientMessagePt, traceID [16]byte) *SolClientErrorInfoWrapper { + // Sets the traceID property for the creation trace context + return SolClientMessageSetTraceContextTraceID(messageP, traceID, SolClientContextTypeCreationContext) +} + +// SolClientMessageGetCreationTraceContextSpanID function +func SolClientMessageGetCreationTraceContextSpanID(messageP SolClientMessagePt) ([8]byte, *SolClientErrorInfoWrapper) { + // return the spanID property for the creation trace context + return SolClientMessageGetTraceContextSpanID(messageP, SolClientContextTypeCreationContext) +} + +// SolClientMessageSetCreationTraceContextSpanID function +func SolClientMessageSetCreationTraceContextSpanID(messageP SolClientMessagePt, spanID [8]byte) *SolClientErrorInfoWrapper { + // Sets the spanID property for the creation trace context + return SolClientMessageSetTraceContextSpanID(messageP, spanID, SolClientContextTypeCreationContext) +} + +// SolClientMessageGetCreationTraceContextSampled function +func SolClientMessageGetCreationTraceContextSampled(messageP SolClientMessagePt) (bool, *SolClientErrorInfoWrapper) { + // return the Sampled property for the creation trace context + return SolClientMessageGetTraceContextSampled(messageP, SolClientContextTypeCreationContext) +} + +// SolClientMessageSetCreationTraceContextSampled function +func SolClientMessageSetCreationTraceContextSampled(messageP SolClientMessagePt, sampled bool) *SolClientErrorInfoWrapper { + // Sets the Sampled property for the creation trace context + return SolClientMessageSetTraceContextSampled(messageP, sampled, SolClientContextTypeCreationContext) +} + +// SolClientMessageGetCreationTraceContextTraceState function +func SolClientMessageGetCreationTraceContextTraceState(messageP SolClientMessagePt) (string, *SolClientErrorInfoWrapper) { + // return the trace state property for the creation trace context + return SolClientMessageGetTraceContextTraceState(messageP, SolClientContextTypeCreationContext) +} + +// SolClientMessageSetCreationTraceContextTraceState function +func SolClientMessageSetCreationTraceContextTraceState(messageP SolClientMessagePt, traceState string) *SolClientErrorInfoWrapper { + // Sets the trace state property for the creation trace context + return SolClientMessageSetTraceContextTraceState(messageP, traceState, SolClientContextTypeCreationContext) +} + +// For the Transport Context + +// SolClientMessageGetTransportTraceContextTraceID function +func SolClientMessageGetTransportTraceContextTraceID(messageP SolClientMessagePt) ([16]byte, *SolClientErrorInfoWrapper) { + // return the traceID property for the transport trace context + return SolClientMessageGetTraceContextTraceID(messageP, SolClientContextTypeTransportContext) +} + +// SolClientMessageSetTransportTraceContextTraceID function +func SolClientMessageSetTransportTraceContextTraceID(messageP SolClientMessagePt, traceID [16]byte) *SolClientErrorInfoWrapper { + // Sets the traceID property for the transport trace context + return SolClientMessageSetTraceContextTraceID(messageP, traceID, SolClientContextTypeTransportContext) +} + +// SolClientMessageGetTransportTraceContextSpanID function +func SolClientMessageGetTransportTraceContextSpanID(messageP SolClientMessagePt) ([8]byte, *SolClientErrorInfoWrapper) { + // return the spanID property for the transport trace context + return SolClientMessageGetTraceContextSpanID(messageP, SolClientContextTypeTransportContext) +} + +// SolClientMessageSetTransportTraceContextSpanID function +func SolClientMessageSetTransportTraceContextSpanID(messageP SolClientMessagePt, spanID [8]byte) *SolClientErrorInfoWrapper { + // Sets the spanID property for the transport trace context + return SolClientMessageSetTraceContextSpanID(messageP, spanID, SolClientContextTypeTransportContext) +} + +// SolClientMessageGetTransportTraceContextSampled function +func SolClientMessageGetTransportTraceContextSampled(messageP SolClientMessagePt) (bool, *SolClientErrorInfoWrapper) { + // return the Sampled property for the transport trace context + return SolClientMessageGetTraceContextSampled(messageP, SolClientContextTypeTransportContext) +} + +// SolClientMessageSetTransportTraceContextSampled function +func SolClientMessageSetTransportTraceContextSampled(messageP SolClientMessagePt, sampled bool) *SolClientErrorInfoWrapper { + // Sets the Sampled property for the transport trace context + return SolClientMessageSetTraceContextSampled(messageP, sampled, SolClientContextTypeTransportContext) +} + +// SolClientMessageGetTransportTraceContextTraceState function +func SolClientMessageGetTransportTraceContextTraceState(messageP SolClientMessagePt) (string, *SolClientErrorInfoWrapper) { + // return the trace state property for the transport trace context + return SolClientMessageGetTraceContextTraceState(messageP, SolClientContextTypeTransportContext) +} + +// SolClientMessageSetTransportTraceContextTraceState function +func SolClientMessageSetTransportTraceContextTraceState(messageP SolClientMessagePt, traceState string) *SolClientErrorInfoWrapper { + // Sets the trace state property for the transport trace context + return SolClientMessageSetTraceContextTraceState(messageP, traceState, SolClientContextTypeTransportContext) +} + +// For the Baggage + +// SolClientMessageGetBaggage function +func SolClientMessageGetBaggage(messageP SolClientMessagePt) (string, *SolClientErrorInfoWrapper) { + var baggageChar *C.char + var baggageSize C.size_t + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_getBaggagePtr(messageP, &baggageChar, &baggageSize) + }) + if errorInfo != nil { + if errorInfo.ReturnCode == SolClientReturnCodeFail { + logging.Default.Warning( + fmt.Sprintf( + "Encountered error fetching baggage: %s, subcode: %d", + errorInfo.GetMessageAsString(), + errorInfo.SubCode)) + } + return "", errorInfo + } + + // use baggageSize - 1 to exclude the null character at the end of the baggage string + return C.GoStringN(baggageChar, C.int(baggageSize)-1), errorInfo +} + +// SolClientMessageSetBaggage function +func SolClientMessageSetBaggage(messageP SolClientMessagePt, baggage string) *SolClientErrorInfoWrapper { + // if the baggage is empty, delete the baggage from the message pointer + if baggage == "" { + deleteErrorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_deleteBaggage(messageP) + }) + return deleteErrorInfo + } + // set the baggage if there is an actual baggage string + cStr := C.CString(baggage) + defer C.free(unsafe.Pointer(cStr)) // free the pointer after function executes + errorInfo := handleCcsmpError(func() SolClientReturnCode { + return C.solClient_msg_tracing_setBaggage(messageP, cStr) + }) + return errorInfo +} diff --git a/internal/ccsmp/ccsmp_return_code_generated.go b/internal/ccsmp/ccsmp_return_code_generated.go index c73dbb6..b6f137e 100644 --- a/internal/ccsmp/ccsmp_return_code_generated.go +++ b/internal/ccsmp/ccsmp_return_code_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_rmid.go b/internal/ccsmp/ccsmp_rmid.go index 3a3e2dc..0700e59 100644 --- a/internal/ccsmp/ccsmp_rmid.go +++ b/internal/ccsmp/ccsmp_rmid.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_session_event_generated.go b/internal/ccsmp/ccsmp_session_event_generated.go index 1d9b290..1418497 100644 --- a/internal/ccsmp/ccsmp_session_event_generated.go +++ b/internal/ccsmp/ccsmp_session_event_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/ccsmp_session_prop_generated.go b/internal/ccsmp/ccsmp_session_prop_generated.go index bb830ac..5ddb02d 100644 --- a/internal/ccsmp/ccsmp_session_prop_generated.go +++ b/internal/ccsmp/ccsmp_session_prop_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -168,7 +168,7 @@ const ( SolClientSessionPropSslValidateCertificateHost = C.SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST // SolClientSessionPropSslCipherSuites: This property specifies a comma separated list of the cipher suites. Allowed cipher suites are: 'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-SHA384', 'ECDHE-RSA-AES256-SHA', 'AES256-GCM-SHA384', 'AES256-SHA256', 'AES256-SHA', 'ECDHE-RSA-DES-CBC3-SHA', 'DES-CBC3-SHA', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-SHA256', 'ECDHE-RSA-AES128-SHA', 'AES128-GCM-SHA256', 'AES128-SHA256', 'AES128-SHA', 'RC4-SHA', 'RC4-MD5', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA', 'TLS_RSA_WITH_AES_256_GCM_SHA384', 'TLS_RSA_WITH_AES_256_CBC_SHA256', 'TLS_RSA_WITH_AES_256_CBC_SHA', 'TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA', 'SSL_RSA_WITH_3DES_EDE_CBC_SHA', 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA', 'TLS_RSA_WITH_AES_128_GCM_SHA256', 'TLS_RSA_WITH_AES_128_CBC_SHA256', 'TLS_RSA_WITH_AES_128_CBC_SHA', 'SSL_RSA_WITH_RC4_128_SHA', 'SSL_RSA_WITH_RC4_128_MD5'. Default: ::SOLCLIENT_SESSION_PROP_DEFAULT_SSL_CIPHER_SUITES. SolClientSessionPropSslCipherSuites = C.SOLCLIENT_SESSION_PROP_SSL_CIPHER_SUITES - // SolClientSessionPropSslTrustStoreDir: This property specifies the directory where the trusted certificates are. A maximum of 64 certificate files are allowed in the trust store directory. The maximum depth for the certificate chain verification that shall be allowed is 3. + // SolClientSessionPropSslTrustStoreDir: This property specifies the directory where the trusted certificates are. The maximum depth for the certificate chain verification that shall be allowed is 3. SolClientSessionPropSslTrustStoreDir = C.SOLCLIENT_SESSION_PROP_SSL_TRUST_STORE_DIR // SolClientSessionPropSslTrustedCommonNameList: NOT RECOMMENDED. Per RFC-6125 section 6.4.4, the Common Name (CN) of a certificate should not be used to validate the certificate. Instead ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST (enabled by default) indicates that the server certificate must contain a Subject Alternate Name (SAN) that matches the host name (::SOLCLIENT_SESSION_PROP_HOST).

This property is only valid if ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST is disabled. This property specifies a comma separated list of acceptable common names in certificate validation. The number of common names specified by an applications is limited to 16. Leading and trailing whitespaces are considered to be part of the common names and are not ignored. If the application does not provide any common names, there is no common name verification.

NOTE: When ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST is enabled (default), this property should be set to an empty list. Failure to do so may cause the API to reject an otherwise valid certificate. SolClientSessionPropSslTrustedCommonNameList = C.SOLCLIENT_SESSION_PROP_SSL_TRUSTED_COMMON_NAME_LIST diff --git a/internal/ccsmp/ccsmp_session_stats_rx_generated.go b/internal/ccsmp/ccsmp_session_stats_rx_generated.go index c61c319..1738b31 100644 --- a/internal/ccsmp/ccsmp_session_stats_rx_generated.go +++ b/internal/ccsmp/ccsmp_session_stats_rx_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -94,6 +94,12 @@ const ( SolClientStatsRXDiscardMsgTransactionRollback SolClientStatsRX = C.SOLCLIENT_STATS_RX_DISCARD_MSG_TRANSACTION_ROLLBACK // SolClientStatsRXDiscardTransactionResponse: On a transacted session, the number of transaction responses discarded due to reconnection. SolClientStatsRXDiscardTransactionResponse SolClientStatsRX = C.SOLCLIENT_STATS_RX_DISCARD_TRANSACTION_RESPONSE + // SolClientStatsRXSettleAccepted: Number of messages settled with "ACCEPTED" outcome. + SolClientStatsRXSettleAccepted SolClientStatsRX = C.SOLCLIENT_STATS_RX_SETTLE_ACCEPTED + // SolClientStatsRXSettleFailed: Number of messages settled with "FAILED" outcome. + SolClientStatsRXSettleFailed SolClientStatsRX = C.SOLCLIENT_STATS_RX_SETTLE_FAILED + // SolClientStatsRXSettleRejected: Number of messages settled with "REJECTED" outcome. + SolClientStatsRXSettleRejected SolClientStatsRX = C.SOLCLIENT_STATS_RX_SETTLE_REJECTED // SolClientStatsRXNumStats: The size of receive stats array. SolClientStatsRXNumStats SolClientStatsRX = C.SOLCLIENT_STATS_RX_NUM_STATS ) diff --git a/internal/ccsmp/ccsmp_session_stats_tx_generated.go b/internal/ccsmp/ccsmp_session_stats_tx_generated.go index 157ea65..e32ea1a 100644 --- a/internal/ccsmp/ccsmp_session_stats_tx_generated.go +++ b/internal/ccsmp/ccsmp_session_stats_tx_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/cgo_helpers.go b/internal/ccsmp/cgo_helpers.go index 754c190..d123eac 100644 --- a/internal/ccsmp/cgo_helpers.go +++ b/internal/ccsmp/cgo_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/dummy.go b/internal/ccsmp/dummy.go index b032b21..e6b8540 100644 --- a/internal/ccsmp/dummy.go +++ b/internal/ccsmp/dummy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_endpoint_prop_generator.go b/internal/ccsmp/generator/ccsmp_endpoint_prop_generator.go index 502d5e9..7390c7a 100644 --- a/internal/ccsmp/generator/ccsmp_endpoint_prop_generator.go +++ b/internal/ccsmp/generator/ccsmp_endpoint_prop_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_flow_event_generator.go b/internal/ccsmp/generator/ccsmp_flow_event_generator.go index eb8ea8c..20f2bed 100644 --- a/internal/ccsmp/generator/ccsmp_flow_event_generator.go +++ b/internal/ccsmp/generator/ccsmp_flow_event_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_flow_prop_generator.go b/internal/ccsmp/generator/ccsmp_flow_prop_generator.go index 2fa8670..a2a8d00 100644 --- a/internal/ccsmp/generator/ccsmp_flow_prop_generator.go +++ b/internal/ccsmp/generator/ccsmp_flow_prop_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_global_prop_generator.go b/internal/ccsmp/generator/ccsmp_global_prop_generator.go index a58145d..7d487a7 100644 --- a/internal/ccsmp/generator/ccsmp_global_prop_generator.go +++ b/internal/ccsmp/generator/ccsmp_global_prop_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_log_level_generator.go b/internal/ccsmp/generator/ccsmp_log_level_generator.go index fa46073..d30d50d 100644 --- a/internal/ccsmp/generator/ccsmp_log_level_generator.go +++ b/internal/ccsmp/generator/ccsmp_log_level_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_return_code_generator.go b/internal/ccsmp/generator/ccsmp_return_code_generator.go index 4678032..738e68b 100644 --- a/internal/ccsmp/generator/ccsmp_return_code_generator.go +++ b/internal/ccsmp/generator/ccsmp_return_code_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_session_event_generator.go b/internal/ccsmp/generator/ccsmp_session_event_generator.go index b561154..de7bfa1 100644 --- a/internal/ccsmp/generator/ccsmp_session_event_generator.go +++ b/internal/ccsmp/generator/ccsmp_session_event_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_session_prop_generator.go b/internal/ccsmp/generator/ccsmp_session_prop_generator.go index 3c2f364..d72b97a 100644 --- a/internal/ccsmp/generator/ccsmp_session_prop_generator.go +++ b/internal/ccsmp/generator/ccsmp_session_prop_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/generator/ccsmp_session_stats_generator.go b/internal/ccsmp/generator/ccsmp_session_stats_generator.go index 7a8c24b..725e36c 100644 --- a/internal/ccsmp/generator/ccsmp_session_stats_generator.go +++ b/internal/ccsmp/generator/ccsmp_session_stats_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/includes_darwin_amd64.go b/internal/ccsmp/includes_darwin_amd64.go index b6af143..0a10061 100644 --- a/internal/ccsmp/includes_darwin_amd64.go +++ b/internal/ccsmp/includes_darwin_amd64.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/includes_darwin_arm64.go b/internal/ccsmp/includes_darwin_arm64.go index 309bfed..c5992aa 100644 --- a/internal/ccsmp/includes_darwin_arm64.go +++ b/internal/ccsmp/includes_darwin_arm64.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2023 Solace Corporation. All rights reserved. +// Copyright 2023-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/includes_linux_amd64.go b/internal/ccsmp/includes_linux_amd64.go index 87f931d..d107cd5 100644 --- a/internal/ccsmp/includes_linux_amd64.go +++ b/internal/ccsmp/includes_linux_amd64.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/includes_linux_arm64.go b/internal/ccsmp/includes_linux_arm64.go index c5ae4cf..652fc4e 100644 --- a/internal/ccsmp/includes_linux_arm64.go +++ b/internal/ccsmp/includes_linux_arm64.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/lib/README.md b/internal/ccsmp/lib/README.md index ff7d008..6322a44 100644 --- a/internal/ccsmp/lib/README.md +++ b/internal/ccsmp/lib/README.md @@ -1,3 +1,3 @@ The lib directory contains the native C library (Solace PubSub+ API for C) used by the Solace PubSub+ for Go API. -Copyright 2021-2023 Solace Corporation. All rights reserved. +Copyright 2021-2024 Solace Corporation. All rights reserved. diff --git a/internal/ccsmp/lib/darwin/dummy.go b/internal/ccsmp/lib/darwin/dummy.go index cfcf476..05d17dc 100644 --- a/internal/ccsmp/lib/darwin/dummy.go +++ b/internal/ccsmp/lib/darwin/dummy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/lib/darwin/libsolclient.a b/internal/ccsmp/lib/darwin/libsolclient.a index ec601c2..e4f85cd 100644 Binary files a/internal/ccsmp/lib/darwin/libsolclient.a and b/internal/ccsmp/lib/darwin/libsolclient.a differ diff --git a/internal/ccsmp/lib/include/solclient/dummy.go b/internal/ccsmp/lib/include/solclient/dummy.go index 98b90d1..a4b0d6c 100644 --- a/internal/ccsmp/lib/include/solclient/dummy.go +++ b/internal/ccsmp/lib/include/solclient/dummy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/lib/include/solclient/solClient.h b/internal/ccsmp/lib/include/solclient/solClient.h index a1dcf1a..8ae4263 100644 --- a/internal/ccsmp/lib/include/solclient/solClient.h +++ b/internal/ccsmp/lib/include/solclient/solClient.h @@ -2,7 +2,7 @@ * * @file solClient.h include file for the Solace Corporation Messaging API for C * -* Copyright 2007-2023 Solace Corporation. All rights reserved. +* Copyright 2007-2024 Solace Corporation. All rights reserved. * * This include file provides the public constants and API calls for clients * connecting to a Solace messaging broker. @@ -154,7 +154,7 @@ extern "C" For example "level1/lev* /level3" matches "/level1/level2/level3". \n A '*'cannot appear at the beginning or within a string. For example, "lev*1" and "*evel" are not valid. - @section topic-dispatch Dispatching Messages Based on a Topic + @subsection topic-dispatch Dispatching Messages Based on a Topic By default, when subscriptions are added, all messages are dispatched to the Session message receive callback that is defined when the Session is created (through the ::solClient_session_createFuncInfo_t parameter of ::solClient_session_create). However, a Session can also be configured through the Session @@ -243,8 +243,40 @@ extern "C" ::solClient_session_topicUnsubscribeWithDispatch(), providing a NULL pointer for the callback and the user pointer or providing a NULL pointer to the dispatch information is equivalent to calling solClient_session_topicUnsubscribeExt(). + @subsection flow-topic-dispatch Dispatching Messages Based on a Topic for a Flow + + Topic dispatching is also available on Flows to Queues and Topic Endpoints. + + A Queue endpoint Flow may have many topics associated with it. Topics may be added to Queue + endpoint Flows with the Session function, solClient_session_endpointTopicSubscribe(), or with the + Flow function, solClient_flow_topicSubscribeWithDispatch(). + + A Topic Endpoint Flow only has a single Topic which is defined when the Flow is created + (see ::SOLCLIENT_FLOW_PROP_TOPIC). Topic dispatching for a Topic Endpoint Flow can be + useful when the Flow's Topic contains wildcards because the Topic dispatching capability can + then be used to separate out different topics covered by the Flow's wildcard topic. + + As with solClient_session_topicSubscribeWithDispatch(), the @ref subscribeflags "subscribe flag" + ::SOLCLIENT_SUBSCRIBE_FLAGS_LOCAL_DISPATCH_ONLY may be used on a + Queue endpoint Flow to add a dispatch callback entry only. ::SOLCLIENT_SUBSCRIBE_FLAGS_LOCAL_DISPATCH_ONLY is + implied on a Topic Endpoint Flow as adding topics dynamically to a Topic Endpoint is not supported. + + solClient_flow_topicSubscribeWithDispatch() can be used to add a Topic subscription only (no dispatch entry) to the Queue + endpoint by setting the dispatch information to NULL. + + Similar to a Session, Topic dispatching on a Flow is controlled by the functions + ::solClient_flow_topicSubscribeWithDispatch() and ::solClient_flow_topicUnsubscribeWithDispatch(). + Note that for a Topic Endpoint the ::solClient_flow_topicSubscribeWithDispatch() and ::solClient_flow_topicUnsubscribeWithDispatch() functions only control the dispatching of messages received on the Flow and do + not affect which messages are received on the Flow. The only property that controls the messages + received on a Flow to a Topic Endpoint is ::SOLCLIENT_FLOW_PROP_TOPIC. + + No check is made to ensure that any Topic subscribed to through ::solClient_flow_topicSubscribeWithDispatch() + is actually received on the Topic Endpoint Flow. For example, if the Topic Endpoint Flow was created with Topic 'level1/>', + if ::solClient_flow_topicSubscribeWithDispatch() is invoked with a Topic of 'level2/level3', that topic + is accepted, but the callback for that Topic is never invoked as the Flow will not attract + messages that match that topic. - @subsection host-entry Configuring Host Entry for SOLCLIENT_SESSION_PROP_HOST property + @section host-entry Configuring Host Entry for SOLCLIENT_SESSION_PROP_HOST property The entry for the SOLCLIENT_SESSION_PROP_HOST property should provide a protocol, host, and port. The SOLCLIENT_SESSION_PROP_HOST @@ -356,38 +388,6 @@ extern "C" (::SOLCLIENT_SESSION_EVENT_CONNECT_FAILED_ERROR) may have to wait up to (<number of hosts in list> times ::SOLCLIENT_SESSION_PROP_CONNECT_TIMEOUT_MS) for the event. - @subsection flow-topic-dispatch Dispatching Messages Based on a Topic for a Flow - - Topic dispatching is also available on Flows to Queues and Topic Endpoints. - - A Queue endpoint Flow may have many topics associated with it. Topics may be added to Queue - endpoint Flows with the Session function, solClient_session_endpointTopicSubscribe(), or with the - Flow function, solClient_flow_topicSubscribeWithDispatch(). - - A Topic Endpoint Flow only has a single Topic which is defined when the Flow is created - (see ::SOLCLIENT_FLOW_PROP_TOPIC). Topic dispatching for a Topic Endpoint Flow can be - useful when the Flow's Topic contains wildcards because the Topic dispatching capability can - then be used to separate out different topics covered by the Flow's wildcard topic. - - As with solClient_session_topicSubscribeWithDispatch(), the @ref subscribeflags "subscribe flag" - ::SOLCLIENT_SUBSCRIBE_FLAGS_LOCAL_DISPATCH_ONLY may be used on a - Queue endpoint Flow to add a dispatch callback entry only. ::SOLCLIENT_SUBSCRIBE_FLAGS_LOCAL_DISPATCH_ONLY is - implied on a Topic Endpoint Flow as adding topics dynamically to a Topic Endpoint is not supported. - - solClient_flow_topicSubscribeWithDispatch() can be used to add a Topic subscription only (no dispatch entry) to the Queue - endpoint by setting the dispatch information to NULL. - - Similar to a Session, Topic dispatching on a Flow is controlled by the functions - ::solClient_flow_topicSubscribeWithDispatch() and ::solClient_flow_topicUnsubscribeWithDispatch(). - Note that for a Topic Endpoint the ::solClient_flow_topicSubscribeWithDispatch() and ::solClient_flow_topicUnsubscribeWithDispatch() functions only control the dispatching of messages received on the Flow and do - not affect which messages are received on the Flow. The only property that controls the messages - received on a Flow to a Topic Endpoint is ::SOLCLIENT_FLOW_PROP_TOPIC. - - No check is made to ensure that any Topic subscribed to through ::solClient_flow_topicSubscribeWithDispatch() - is actually received on the Topic Endpoint Flow. For example, if the Topic Endpoint Flow was created with Topic 'level1/>', - if ::solClient_flow_topicSubscribeWithDispatch() is invoked with a Topic of 'level2/level3', that topic - is accepted, but the callback for that Topic is never invoked as the Flow will not attract - messages that match that topic. @section feature-limitations Feature Limitations @@ -699,7 +699,7 @@ typedef struct solClient_field { */ typedef enum solClient_rxMsgCallback_returnCode { SOLCLIENT_CALLBACK_OK = 0, /**< Normal return - the message is destroyed by the API upon return. */ - SOLCLIENT_CALLBACK_TAKE_MSG = 1 /**< The application is keeping the rxMsg, and it must not be released or reused by the API .*/ + SOLCLIENT_CALLBACK_TAKE_MSG = 1, /**< The application is keeping the rxMsg, and it must not be released or reused by the API .*/ } solClient_rxMsgCallback_returnCode_t; /** @@ -1554,6 +1554,16 @@ typedef struct solClient_field { * The client has attempted to publish to a topic that matched a queue or topic endpoint subscription which has its ingress flow shutdown. * 503 Endpoint Shutdown * +* +* SOLCLIENT_SUBCODE_AD_APP_ACK_FAILED_NOT_SUPPORTED +* The AD_APP_ACK_FAILED capability needed for "Fail" and "Reject" message settlement outcomes is not supported in the Solace Message Router. +* N/A +* +* +* SOLCLIENT_SUBCODE_INVALID_DURABILITY +* The client has attempted to bind a flow to a durable queue or topic endpoint with SOLCLIENT_FLOW_PROP_BIND_ENTITY_DURABLE disabled. +* 400 Invalid Queue or Topic Endpoint Durability +* * */ typedef enum solClient_subCode @@ -1720,11 +1730,13 @@ typedef struct solClient_field { SOLCLIENT_SUBCODE_DELIVERY_COUNT_NOT_SUPPORTED = 155, /**< The message was received from endpoint that does not support delivery count */ SOLCLIENT_SUBCODE_REPLAY_START_MESSAGE_UNAVAILABLE = 156, /**< A replay was requested but the requested start message is not available in the replay log. */ SOLCLIENT_SUBCODE_MESSAGE_ID_NOT_COMPARABLE = 157, /**< Replication Group Message Id are not comparable. Messages must be published to the same broker or HA pair for their Replicaton Group Message Id to be comparable. */ - SOLCLIENT_SUBCODE_REPLAY_ANONYMOUS_NOT_SUPPORTED = 158, /**< The client attempted to start replay on a flow bound to an anonymous queue. */ - SOLCLIENT_SUBCODE_BROWSING_NOT_SUPPORTED_ON_PARTITIONED_QUEUE = 159, /**< Browser flows to Partitioned Queues are not permitted. */ - SOLCLIENT_SUBCODE_SELECTORS_NOT_SUPPORTED_ON_PARTITIONED_QUEUE = 160, /**< Egress selectors are not permitted when binding to a Partitioned Queue. */ - SOLCLIENT_SUBCODE_SYNC_REPLICATION_INELIGIBLE = 161, /**< A guaranteed message was rejected because the broker has been configured to reject messages when sync replication mode is ineligible. A transaction commit failed because replication became ineligible during the transaction. */ + SOLCLIENT_SUBCODE_REPLAY_ANONYMOUS_NOT_SUPPORTED = 158, /**< The client attempted to start replay on a flow bound to an anonymous queue. */ + SOLCLIENT_SUBCODE_BROWSING_NOT_SUPPORTED_ON_PARTITIONED_QUEUE = 159, /**< Browser flows to Partitioned Queues are not permitted. */ + SOLCLIENT_SUBCODE_SELECTORS_NOT_SUPPORTED_ON_PARTITIONED_QUEUE = 160, /**< Egress selectors are not permitted when binding to a Partitioned Queue. */ + SOLCLIENT_SUBCODE_SYNC_REPLICATION_INELIGIBLE = 161, /**< A guaranteed message was rejected because the broker has been configured to reject messages when sync replication mode is ineligible. A transaction commit failed because replication became ineligible during the transaction. */ SOLCLIENT_SUBCODE_ENDPOINT_SHUTDOWN = 162, /**< The client has attempted to publish to a topic that matched a queue or topic endpoint subscription which has its ingress flow shutdown. */ + SOLCLIENT_SUBCODE_AD_APP_ACK_FAILED_NOT_SUPPORTED = 163, /**< Fail and Reject message settlement outcomes not supported on the Solace Message Router. */ + SOLCLIENT_SUBCODE_INVALID_DURABILITY = 164, /**< The client has attempted to bind a flow to a durable queue or topic endpoint with SOLCLIENT_FLOW_PROP_BIND_ENTITY_DURABLE disabled. */ /* * ADDING NEW SUBCODES: When adding a new subcode always add a new entry to the HTML table in * the comment above this enumeration @@ -2035,6 +2047,7 @@ typedef struct solClient_uuid #define SOLCLIENT_CONTEXT_PROP_TIME_RES_MS "CONTEXT_TIME_RES_MS" /**< The internal timer resolution (in milliseconds). Valid range is >= 10 and <= 10000. Default: ::SOLCLIENT_CONTEXT_PROP_DEFAULT_TIME_RES_MS */ #define SOLCLIENT_CONTEXT_PROP_CREATE_THREAD "CONTEXT_CREATE_THREAD" /**< Use ::SOLCLIENT_PROP_ENABLE_VAL to have the Context thread created automatically (as opposed to the application creating and destroying this thread). Default: ::SOLCLIENT_CONTEXT_PROP_DEFAULT_CREATE_THREAD */ #define SOLCLIENT_CONTEXT_PROP_THREAD_AFFINITY "CONTEXT_THREAD_AFFINITY" /**< The desired thread affinity mask for the Context thread. A thread affinity mask is a bit vector in which each bit represents a logical processor that a thread is allowed to run on. Only used if the Context thread is automatically created. For Solaris, only 1 bit can be set (that is, the thread will run on only one processor). Not supported on AIX. A value of zero means the affinity is not set, and the parent's affinity is used. A value of 1 means use processor 0, a value of 2 means use processor 1, a value of 3 means use both processor 0 and 1, and so on. Default: ::SOLCLIENT_CONTEXT_PROP_DEFAULT_THREAD_AFFINITY */ +#define SOLCLIENT_CONTEXT_PROP_THREAD_AFFINITY_CPU_LIST "CONTEXT_THREAD_AFFINITY_CPU_LIST" /**< The desired thread affinity for the Context thread in the form of a comma-separated list of base-10 non-negative integers and dash-separated ranges. The union of this property and SOLCLIENT_CONTEXT_PROP_THREAD_AFFINITY is used. Each number (and each number in a range) represents a logical processor that a thread is allowed to run on. Only used if the Context thread is automatically created. For Solaris, only 1 number can be supplied (that is, the thread will run on only one processor). Not supported on AIX or OpenVMS. The empty string means the affinity is not set, and the parent's affinity is used. A value of "0" means use processor 0, a value of "1" means use processor 1, a value of "0,1" or "0-1" means use both processor 0 and 1, and so on. Default: ::SOLCLIENT_CONTEXT_PROP_DEFAULT_THREAD_AFFINITY_CPU_LIST */ /*@}*/ /** @defgroup DefaultContextProps Default Context Configuration Properties @@ -2044,6 +2057,7 @@ typedef struct solClient_uuid #define SOLCLIENT_CONTEXT_PROP_DEFAULT_TIME_RES_MS "50" /**< The default value for timer resolution (in milliseconds). */ #define SOLCLIENT_CONTEXT_PROP_DEFAULT_CREATE_THREAD SOLCLIENT_PROP_DISABLE_VAL /**< The default value for create Context thread. By default the thread is created and destroyed by the application. */ #define SOLCLIENT_CONTEXT_PROP_DEFAULT_THREAD_AFFINITY "0" /**< By default, the thread affinity for the auto-created Context thread is not set. */ +#define SOLCLIENT_CONTEXT_PROP_DEFAULT_THREAD_AFFINITY_CPU_LIST "" /**< By default, the thread affinity for the auto-created Context thread is not set. */ /*@}*/ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -2229,7 +2243,7 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN #define SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_DATE "SESSION_SSL_VALIDATE_CERTIFICATE_DATE" /**< This property indicates if the session connection should fail when a certificate with an invalid date (current date before valid date, or current date after expiry) is received. This property only applies when ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE is enabled.

Default: ::SOLCLIENT_SESSION_PROP_DEFAULT_SSL_VALIDATE_CERTIFICATE_DATE.

See also @ref certificate-validation */ #define SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST "SESSION_SSL_VALIDATE_CERTIFICATE_HOST" /**< This property indicates if the session connection should fail when a certificate with an invalid host is received. When enabled, and connecting to a named host, the certificate Subject Alternative Name must contain a DNS entry that matches the host string. When enabled, and connecting to a host by IP address, the certificate Subject Alternative Name must contain an IP Address that matches. If there is no Subject Alternate Name the certificate common name (CN) must match the named host. This property only applies when ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE is enabled.

Default: ::SOLCLIENT_SESSION_PROP_DEFAULT_SSL_VALIDATE_CERTIFICATE_HOST.

See also @ref certificate-validation */ #define SOLCLIENT_SESSION_PROP_SSL_CIPHER_SUITES "SESSION_SSL_CIPHER_SUITES" /**< This property specifies a comma separated list of the cipher suites. Allowed cipher suites are: 'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-SHA384', 'ECDHE-RSA-AES256-SHA', 'AES256-GCM-SHA384', 'AES256-SHA256', 'AES256-SHA', 'ECDHE-RSA-DES-CBC3-SHA', 'DES-CBC3-SHA', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-SHA256', 'ECDHE-RSA-AES128-SHA', 'AES128-GCM-SHA256', 'AES128-SHA256', 'AES128-SHA', 'RC4-SHA', 'RC4-MD5', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA', 'TLS_RSA_WITH_AES_256_GCM_SHA384', 'TLS_RSA_WITH_AES_256_CBC_SHA256', 'TLS_RSA_WITH_AES_256_CBC_SHA', 'TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA', 'SSL_RSA_WITH_3DES_EDE_CBC_SHA', 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA', 'TLS_RSA_WITH_AES_128_GCM_SHA256', 'TLS_RSA_WITH_AES_128_CBC_SHA256', 'TLS_RSA_WITH_AES_128_CBC_SHA', 'SSL_RSA_WITH_RC4_128_SHA', 'SSL_RSA_WITH_RC4_128_MD5'. Default: ::SOLCLIENT_SESSION_PROP_DEFAULT_SSL_CIPHER_SUITES. */ -#define SOLCLIENT_SESSION_PROP_SSL_TRUST_STORE_DIR "SESSION_SSL_TRUST_STORE_DIR" /**< This property specifies the directory where the trusted certificates are. A maximum of 64 certificate files are allowed in the trust store directory. The maximum depth for the certificate chain verification that shall be allowed is 3. */ +#define SOLCLIENT_SESSION_PROP_SSL_TRUST_STORE_DIR "SESSION_SSL_TRUST_STORE_DIR" /**< This property specifies the directory where the trusted certificates are. The maximum depth for the certificate chain verification that shall be allowed is 3. */ #define SOLCLIENT_SESSION_PROP_SSL_TRUSTED_COMMON_NAME_LIST "SESSION_SSL_TRUSTED_COMMON_NAME_LIST" /**< NOT RECOMMENDED. Per RFC-6125 section 6.4.4, the Common Name (CN) of a certificate should not be used to validate the certificate. Instead ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST (enabled by default) indicates that the server certificate must contain a Subject Alternate Name (SAN) that matches the host name (::SOLCLIENT_SESSION_PROP_HOST).

This property is only valid if ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST is disabled. This property specifies a comma separated list of acceptable common names in certificate validation. The number of common names specified by an applications is limited to 16. Leading and trailing whitespaces are considered to be part of the common names and are not ignored. If the application does not provide any common names, there is no common name verification.

NOTE: When ::SOLCLIENT_SESSION_PROP_SSL_VALIDATE_CERTIFICATE_HOST is enabled (default), this property should be set to an empty list. Failure to do so may cause the API to reject an otherwise valid certificate. */ /*@}*/ @@ -2381,6 +2395,7 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN #define SOLCLIENT_SESSION_PROP_MAX_CLIENT_NAME_LEN (160) /**< The maximum length of client name string (Session property), not including the NULL terminator. */ #define SOLCLIENT_SESSION_PROP_MAX_VPN_NAME_LEN (32) /**< The maximum length of a Message VPN name string (Session property), not including the NULL terminator. */ #define SOLCLIENT_SESSION_PROP_MAX_VIRTUAL_ROUTER_NAME_LEN (52) /**< The maximum length of a virtual router name (read-only Session property), not including the NULL terminator. */ +#define SOLCLIENT_CONTEXT_PROP_MAX_CPU_LIST_LEN (255) /**< The maximum length of the SOLCLIENT_CONTEXT_PROP_THREAD_AFFINITY_CPU_LIST string (Context property), not including the NULL terminator. */ /*@}*/ /** @anchor flowProps @@ -2418,6 +2433,8 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN #define SOLCLIENT_FLOW_PROP_REPLAY_START_LOCATION "FLOW_REPLAY_START_LOCATION" /**< When a Flow is created, the application may request replay of messages from the replay log, even messages that have been previously delivered and removed the from topic endpoint or queue. The replay start location may be ::SOLCLIENT_FLOW_PROP_REPLAY_START_LOCATION_BEGINNING to indicate that all messages available should be replayed. Or the replay start location may be a string that begins with "DATE:" followed by a date in one of two formats. The date may be a string representing a long integer, which is the number of seconds since the epoch - 0:00:00 Jan 1, 1970. The date may be a string as specified in RFC3339 - 'YYYY-MM-DDTHH:MM:SS[.1*DIGIT]Z' or 'YYYY-MM-DDTHH:MM:SS[.1*DIGIT]("+"/"-")HH:MM'. Additionally, the replay start location may be a replication-group-message-id string as returned by solClient_replicationGroupMessageId_toString(). Such a string starts with "rmid1:" and is a ::solClient_replicationGroupMessageId_t. */ #define SOLCLIENT_FLOW_PROP_MAX_RECONNECT_TRIES "FLOW_MAX_RECONNECT_TRIES" /**< When a flow is unbound by the message-broker due to "Replay Started" or "Service Unavailable", the API will attempt to reconnect the flow if this property is non-zero. If this property is -1, it will retry forever. Otherwise it tries the configured maximum number of times. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_MAX_RECONNECT_TRIES */ #define SOLCLIENT_FLOW_PROP_RECONNECT_RETRY_INTERVAL_MS "FLOW_RECONNECT_RETRY_INTERVAL_MS" /**< When a flow is reconnecting, the API will attempt to reconnect immediately, if that bind attempt fails it will wait for the retry interval before attempting to connect again. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_RECONNECT_RETRY_INTERVAL_MS */ +#define SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_FAILED "FLOW_REQUIRED_OUTCOME_FAILED" /**< Create a flow that allows solClient_flow_settleMsg() with SOLCLIENT_OUTCOME_FAILED. Ignored on transacted sessions. Requires SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_FAILED */ +#define SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_REJECTED "FLOW_REQUIRED_OUTCOME_REJECTED" /**< Create a flow that allows solClient_flow_settleMsg() with SOLCLIENT_OUTCOME_REJECTED. Ignored on transacted sessions. Requires SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED. Default: ::SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_REJECTED */ /** @name Default Flow Configuration Properties * The default values for Flow configuration. @@ -2443,6 +2460,8 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN #define SOLCLIENT_FLOW_PROP_DEFAULT_REPLAY_START_LOCATION "" /**< The default value for ::SOLCLIENT_FLOW_PROP_REPLAY_START_LOCATION is no replay requested. */ #define SOLCLIENT_FLOW_PROP_DEFAULT_MAX_RECONNECT_TRIES "-1" /**< The default value for ::SOLCLIENT_FLOW_PROP_MAX_RECONNECT_TRIES. */ #define SOLCLIENT_FLOW_PROP_DEFAULT_RECONNECT_RETRY_INTERVAL_MS "3000" /**< The default reconnect retry interval timer */ +#define SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_FAILED SOLCLIENT_PROP_DISABLE_VAL /**< Failing messages is disabled by default */ +#define SOLCLIENT_FLOW_PROP_DEFAULT_REQUIRED_OUTCOME_REJECTED SOLCLIENT_PROP_DISABLE_VAL /**< Rejecting messages is disabled by default */ /*@}*/ @@ -2588,7 +2607,9 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN #define SOLCLIENT_SESSION_CAPABILITY_LONG_SELECTORS "SESSION_CAPABILITY_LONG_SELECTORS" /**< Boolean - The peer can support selectors longer than 1023 bytes */ #define SOLCLIENT_SESSION_CAPABILITY_SHARED_SUBSCRIPTIONS "SESSION_CAPABILITY_SHARED_SUBSCRIPTIONS" /**< Boolean - The peer can support \#shared and \#noexport subscriptions */ #define SOLCLIENT_SESSION_CAPABILITY_BR_REPLAY_ERRORID "SESSION_CAPABILITY_BR_REPLAY_ERRORID" /**< Boolean - The peer can support the endpoint error id parameter on the flow bind response during message replay */ +#define SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED "SESSION_CAPABILITY_AD_APP_ACK_FAILED" /**< Boolean - The broker supports FAILED and REJECTED message settlement outcomes. */ #define SOLCLIENT_SESSION_CAPABILITY_VAR_LEN_EXT_PARAM "SESSION_CAPABILITY_VAR_LEN_EXT_PARAM" /**< Boolean - The peer can support variable length extended parameters. */ +#define SOLCLIENT_SESSION_CAPABILITY_AD_APP_ACK_FAILED "SESSION_CAPABILITY_AD_APP_ACK_FAILED" /**< Boolean - The broker supports Consumer Redelivery Flows, which support FAIL and REJECT message settlement outcomes. */ #define SOLCLIENT_SESSION_CAPABILITY_ADCTRL_VERSION_MIN "SESSION_CAPABILITY_ADCTRL_VERSION_MIN" /**< Uint32 - Lowest AdCtrl version supported by the broker. */ #define SOLCLIENT_SESSION_CAPABILITY_ADCTRL_VERSION_MAX "SESSION_CAPABILITY_ADCTRL_VERSION_MAX" /**< Uint32 - Highest AdCtrl version supported by the broker. */ /*@}*/ @@ -2710,7 +2731,10 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN SOLCLIENT_STATS_RX_DISCARD_TRANSACTION_RESPONSE = 34, /**< On a transacted session, the number of transaction responses discarded due to reconnection. */ SOLCLIENT_STATS_RX_SSL_READ_EVENTS = 35, SOLCLIENT_STATS_RX_SSL_READ_CALLS = 36, - SOLCLIENT_STATS_RX_NUM_STATS = 37 /**< The size of receive stats array. */ + SOLCLIENT_STATS_RX_SETTLE_ACCEPTED = 37, /**< Number of messages settled with "ACCEPTED" outcome. */ + SOLCLIENT_STATS_RX_SETTLE_FAILED = 38, /**< Number of messages settled with "FAILED" outcome. */ + SOLCLIENT_STATS_RX_SETTLE_REJECTED = 39, /**< Number of messages settled with "REJECTED" outcome. */ + SOLCLIENT_STATS_RX_NUM_STATS = 40 /**< The size of receive stats array. */ } solClient_stats_rx_t; /**< Type that indicates which receive statistic. */ /** @@ -3003,6 +3027,19 @@ Note: This property is used for all entries specified by the property ::SOLCLIEN SOLCLIENT_DISPATCH_TYPE_CALLBACK = 1 /**< Callback on the dispatch function immediately when a message arrives */ } solClient_dispatchType_t; +/** + * @enum solClient_msgOutcome + * The three different possible message outcomes that can be used to settle a message which was received on a flow. + * see \ref ::solClient_flow_settleMsg , \ref ::SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_FAILED , \ref ::SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_REJECTED + */ + +typedef enum solClient_msgOutcome +{ + SOLCLIENT_OUTCOME_ACCEPTED = 0, /**< The message was successfully processed. */ + SOLCLIENT_OUTCOME_FAILED = 2, /**< Message processing failed temporarily, attempt redelivery if configured. */ + SOLCLIENT_OUTCOME_REJECTED = 3 /**< Message deemed permanently unprocessable, move to DMQ if configured, no redelivery. */ +} solClient_msgOutcome_t; + /** * A function prototype for OPTIONAL application-supplied file descriptor registration service. * @param app_p The opaque pointer that was supplied when the file descriptor register function was configured. @@ -5043,6 +5080,7 @@ solClient_session_sendReply (solClient_opaqueSession_pt opaqueSession_p, * @li ::SOLCLIENT_SUBCODE_UNKNOWN_START_LOCATION_TYPE * @li ::SOLCLIENT_SUBCODE_REPLAY_START_TIME_NOT_AVAILABLE * @li ::SOLCLIENT_SUBCODE_REPLAY_START_MESSAGE_UNAVAILABLE +* @li ::SOLCLIENT_SUBCODE_AD_APP_ACK_FAILED_NOT_SUPPORTED * @see ::solClient_subCode for a description of all subcodes. */ solClient_dllExport solClient_returnCode_t @@ -5088,6 +5126,9 @@ solClient_session_sendReply (solClient_opaqueSession_pt opaqueSession_p, /** + * This function is now just a convenience shorthand for calling solClient_flow_settleMsg() + * with the SOLCLIENT_OUTCOME_ACCEPTED outcome. + * * Sends an acknowledgment on the specified Flow. This instructs the API to consider * the specified msgID acknowledged at the application layer. The library * does not send acknowledgments immediately. It stores the state for @@ -5099,6 +5140,8 @@ solClient_session_sendReply (solClient_opaqueSession_pt opaqueSession_p, * on another may result in no message being removed from the message-spool or the wrong * message being removed from the message-spool. * + * Ignored on transacted flows. + * * The exact behavior of solClient_flow_sendAck() is controlled by Flow property * ::SOLCLIENT_FLOW_PROP_ACKMODE: * @li SOLCLIENT_FLOW_PROP_ACKMODE_AUTO - messages are acknowledged automatically by C API @@ -5120,6 +5163,58 @@ solClient_session_sendReply (solClient_opaqueSession_pt opaqueSession_p, solClient_flow_sendAck (solClient_opaqueFlow_pt opaqueFlow_p, solClient_msgId_t msgId); + +/** + * Sends a positive or negative acknowledgment on the specified Flow. This instructs the API to consider + * the specified msgID acknowledged at the application layer. The library + * does not send positive acknowledgments immediately. It stores the state for + * acknowledged messages internally and acknowledges messages, in bulk, when a + * threshold or timer is reached. Negative outcomes are sent immediately. + * + * Use this function instead of solClient_flow_sendAck on flows configured for negative outcomes. + * Besides SOLCLIENT_OUTCOME_ACCEPTED, which is equivalent to an Ack, negative outcomes are allowed too. + * SOLCLIENT_OUTCOME_FAILED means the message will be redelivered, + * SOLCLIENT_OUTCOME_REJECTED means the message is removed from the queue and moved to the DMQ if configured. + * + * Applications must only settle a message on the Flow on which + * it was received. Using the msgId received on one Flow when settling + * on another may result in no message being removed from (or returned to) the message-spool or the wrong + * message being removed from (or returned to) the message-spool. + * + * Ignored on transacted flows. + * + * The exact behavior of solClient_flow_settleMsg() is controlled by Flow property + * ::SOLCLIENT_FLOW_PROP_ACKMODE: + * @li SOLCLIENT_FLOW_PROP_ACKMODE_AUTO - messages are settled automatically by C API, + * and calling this function has no effect. + * @li SOLCLIENT_FLOW_PROP_ACKMODE_CLIENT - every message received must be settled by the + * application through individual calls to solClient_flow_settleMsg(). + * + * WARNING: If ::SOLCLIENT_FLOW_PROP_ACKMODE is set to ::SOLCLIENT_FLOW_PROP_ACKMODE_AUTO + * (the default behavior), the function returns ::SOLCLIENT_OK, but with a warning that + * solClient_flow_settleMsg is ignored as the flow is in auto-ack mode. + * + * WARNING: If ::SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_FAILED and/or ::SOLCLIENT_FLOW_PROP_REQUIRED_OUTCOME_REJECTED is not set, + * (the default behavior), but SOLCLIENT_OUTCOME_FAILED and/or SOLCLIENT_OUTCOME_REJECTED is attempted, + * the function returns ::SOLCLIENT_FAIL with subcode SOLCLIENT_SUBCODE_INVALID_FLOW_OPERATION, + * the message is not settled on the broker, and a warning is logged that + * solClient_flow_settleMsg is ignored because the flow was not set up for it. + * + * @param opaqueFlow_p The opaque Flow that is returned when the Flow was created. + * @param msgId The 64-bit messageId for the settleded message. + * @param outcome The positive or negative outcome with which the message is settled. + * @return ::SOLCLIENT_OK, ::SOLCLIENT_FAIL + * @subcodes + * @see ::solClient_subCode for a description of all subcodes. + */ + solClient_dllExport solClient_returnCode_t + solClient_flow_settleMsg(solClient_opaqueFlow_pt opaqueFlow_p, + solClient_msgId_t msgId, + solClient_msgOutcome_t outcome); + + + + /** * Closes the receiver on the specified Flow. This method will close the Flow * window to the broker so further messages will not be received until @@ -5556,6 +5651,8 @@ solClient_transactedSession_createFlow (solClient_propertyArray_pt props, solClient_flow_createFuncInfo_t *funcInfo_p, size_t funcInfoSize); +#define SOLCLIENT_TRANSACTEDSESSION_MAX_SESSION_NAME_LENGTH 64 /**< The maximum transacted session name length. */ + /** Retrieve Transacted Session name * @see @ref transacted-session * @@ -5567,8 +5664,6 @@ solClient_transactedSession_createFlow (solClient_propertyArray_pt props, * @subcodes * @see ::solClient_subCode for a description of subcodes. */ -#define SOLCLIENT_TRANSACTEDSESSION_MAX_SESSION_NAME_LENGTH 64 /**< The maximum transacted session name length. */ - solClient_dllExport solClient_returnCode_t solClient_transactedSession_getSessionName( solClient_opaqueTransactedSession_pt transactedSession_p, diff --git a/internal/ccsmp/lib/include/solclient/solClientDeprecated.h b/internal/ccsmp/lib/include/solclient/solClientDeprecated.h index 913ce20..71e9653 100644 --- a/internal/ccsmp/lib/include/solclient/solClientDeprecated.h +++ b/internal/ccsmp/lib/include/solclient/solClientDeprecated.h @@ -4,7 +4,7 @@ * * @file solClientDeprecated.h include file for the Solace Corporation Messaging API for C * -* Copyright 2007-2023 Solace Corporation. All rights reserved. +* Copyright 2007-2024 Solace Corporation. All rights reserved. * * This include file provides the deprecated public constants and API calls for clients * connecting to a Solace messaging appliance. This file is provided for backwards diff --git a/internal/ccsmp/lib/include/solclient/solClientMsg.h b/internal/ccsmp/lib/include/solclient/solClientMsg.h index 732aa87..646e208 100644 --- a/internal/ccsmp/lib/include/solclient/solClientMsg.h +++ b/internal/ccsmp/lib/include/solclient/solClientMsg.h @@ -1,7 +1,7 @@ /** * @file solClientMsg.h include file for Solace Corporation Messaging Buffer Management * -* Copyright 2008-2023 Solace Corporation. All rights reserved. +* Copyright 2008-2024 Solace Corporation. All rights reserved. */ /** @page msgbuffer Solace Message Buffers * diff --git a/internal/ccsmp/lib/include/solclient/solClientMsgTracingSupport.h b/internal/ccsmp/lib/include/solclient/solClientMsgTracingSupport.h new file mode 100644 index 0000000..da26a25 --- /dev/null +++ b/internal/ccsmp/lib/include/solclient/solClientMsgTracingSupport.h @@ -0,0 +1,329 @@ + +#ifndef SOLCLIENTMSGTRACINGSUPPORT_H +#define SOLCLIENTMSGTRACINGSUPPORT_H + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/** + * Trace context type + */ +typedef enum solClient_msg_tracing_context_type +{ + TRANSPORT_CONTEXT = 0, + CREATION_CONTEXT = 1 +} solClient_msg_tracing_context_type_t; + +/** + * Injection Standard type + */ +typedef enum solClient_msg_tracing_injection_standard_type +{ + SOLCLIENT_INJECTION_STANDARD_SMF = 0, + SOLCLIENT_INJECTION_STANDARD_W3C = 1 +} solClient_msg_tracing_injection_standard_type_t; + +/** + * Copies the value of trace identifier associated with this message as + * byte array from a specified context into the given pointer. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to be used for retrieval; one of ::solClient_msg_tracing_context_type. + * @param traceId_p An address of a byte array large enough to hold the traceId + * @param size A maximum length of traceId byte array, usual size of a trace id byte array is 16. + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getTraceIdByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + solClient_uint8_t *traceId_p, + size_t size); + + + +/** + * Copies the value of span identifier from a specified context associated with this message as + * a byte array into the given pointer. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to be used for retrieval; one of ::solClient_msg_tracing_context_type. + * @param spanId_p An address of a byte array large enough to hold the spanId + * @param size A maximum length of spanId byte array, usual size of a span id byte array is 8. + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getSpanIdByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + solClient_uint8_t *spanId_p, + size_t size); + + +/** + * Copies the value of a sampled flag from a specified context associated with this message into the given pointer. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to be used for retrieval; one of ::solClient_msg_tracing_context_type. + * @param value True if trace should be sampled, only sampled traces will apper on a backend + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_isSampled (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + solClient_bool_t *value); + + + + + +/** + * Sets the value of trace identifier into a message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The context to update; one of ::solClient_msg_tracing_context_type. + * @param traceId_p A pointer to a byte array with traceId. + * @param size A length of traceId byte array, usual size of a trace id byte array is 16. + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setTraceIdByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const solClient_uint8_t *traceId_p, + size_t size); + + + +/** + * Sets the value of span identifier into a message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The context to update; one of ::solClient_msg_tracing_context_type. + * @param spanId_p A pointer to a byte array with spanId. + * @param size A length of traceId byte array, usual size of a span id byte array is 8. + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setSpanIdByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const solClient_uint8_t *spanId_p, + size_t size); + + +/** + * Sets the value of a sampled flag into a message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The context to update; one of ::solClient_msg_tracing_context_type. + * @param value A sampled flag value to copy from into the message. + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setSampled (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const solClient_bool_t value); + +/** + * Pointer-based getter variant for the TraceState. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The context to access; one of ::solClient_msg_tracing_context_type. + * @param traceState_pp Pointer to traceState within message (output param) It is expected that byte sequence is UTF8 encoded but not null terminated. + * @param size_p The length of traceState string (output param) + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ + +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getTraceStatePtr(solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const char **traceState_pp, + size_t *size_p); + +/** + * Given a msg_p, set the object used for carrying over of the distributed tracing + * message trace state information. This function + * copies in from the given trace state object associated with a given pointer. Changes to it after this function is called + * will not be propagated to this message. The message will be encoded suitable for reading by any other Solace Messaging API. + * Distributed tracing information can be extracted when Solace API supports such extraction. + * If any trace state previously existed in the message it is first removed before the new data is copied in. + * + * Do not call this method with a baggage that is already in the message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive message callback. + * @param contextType The context to access; one of ::solClient_msg_tracing_context_type. + * @param traceState_p A pointer to a null terminated trace state UTF8 encoded string. + * @returns ::SOLCLIENT_OK or ::SOLCLIENT_FAIL if msg_p is invalid or memory is not available. + * @subcodes + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setTraceState(solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const char *traceState_p); + + +/** + * Given a msg_p, set the object used for carrying over of the distributed tracing + * message trace state information. This function + * copies in from the given trace state object associated with a given pointer. Changes to it after this function is called + * will not be propagated to this message. The message will be encoded suitable for reading by any other Solace Messaging API. + * Distributed tracing information can be extracted when Solace API supports such extraction. + * If any trace state previously existed in the message it is first removed before the new data is copied in. + * + * Do not call this method with a baggage that is already in the message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive message callback. + * @param contextType The context to access; one of ::solClient_msg_tracing_context_type. + * @param traceState_p A pointer to the character array containing the trace state with UTF8 encoding but no null termination. + * @param size The size of the trace state character sequence. + * @returns ::SOLCLIENT_OK or ::SOLCLIENT_FAIL if msg_p is invalid or memory is not available. + * @subcodes + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setTraceStatePtr(solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + const char *traceState_p, size_t size); + +/** + * Given a msg_p, retrieves the object used for carrying over of the distributed tracing + * baggage information + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param baggage_p Baggage string pointer on return. It is expected that string is UTF8 encoded. + * @param size A maximum length of baggage string + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getBaggage(solClient_opaqueMsg_pt msg_p, + char *baggage_p, + size_t size); + +/** + * Pointer variant of the distributed tracing baggage getter. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param baggage_pp Baggage string pointer (output param). It is expected that string is UTF8 encoded. + * @param size_p The length of baggage string (output param) + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getBaggagePtr(solClient_opaqueMsg_pt msg_p, + const char **baggage_pp, + size_t *size_p); + + +/** + * Given a msg_p, set the object used for carrying over of the distributed tracing + * message baggage information, as referenced by the given solClient_opaqueTraceContext_pt. This function + * copies in from the given baggage object. Changes to it after this function is called + * will not be propagated to this message. The message will be encoded suitable for reading by any other Solace Messaging API. + * Distributed tracing information can be extracted when Solace API supports such extraction. + * If any baggage previously existed in the message it is first removed before the new data is copied in. + * + * Do not call this method with a baggage that is already in the message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive message callback. + * @param baggage_p A pointer to a null terminated baggage UTF8 encoded string. + * @returns ::SOLCLIENT_OK or ::SOLCLIENT_FAIL if msg_p is invalid or memory is not available. + * @subcodes + * @see ::solClient_subCode for a description of all subcodes. + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setBaggage(solClient_opaqueMsg_pt msg_p, + const char *baggage_p); + + +/** + * Removes a tracing context from a message. All data (fields) set on that context is lost. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to delete; one of ::solClient_msg_tracing_context_type. + * + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_deleteContext(solClient_opaqueMsg_pt opaqueMsg_p, + solClient_msg_tracing_context_type_t contextType); + +/** + * Removes tracing baggage from a message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_deleteBaggage(solClient_opaqueMsg_pt opaqueMsg_p); + + +/** + * Copies the value of the injection standard field in this message as + * byte from a specified context into the given pointer. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to be used for retrieval; one of ::solClient_msg_tracing_context_type. + * @param injectionStandard_p An address of a byte to hold the injection standard + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_getInjectionStandardByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + solClient_msg_tracing_injection_standard_type_t *injectionStandard_p); + +/** + * Updates the value of the injection standard field in the specified context of this message. + * + * @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call + * to solClient_msg_alloc() or received in a receive + * message callback. + * @param contextType The type of context to update; one of ::solClient_msg_tracing_context_type. + * @param injectionStandard The byte to set as the injection standard. + * + * @returns ::SOLCLIENT_OK, ::SOLCLIENT_FAIL, or ::SOLCLIENT_NOT_FOUND + */ +solClient_dllExport solClient_returnCode_t +solClient_msg_tracing_setInjectionStandardByte (solClient_opaqueMsg_pt msg_p, + solClient_msg_tracing_context_type_t contextType, + solClient_msg_tracing_injection_standard_type_t injectionStandard); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif diff --git a/internal/ccsmp/lib/licenses.txt b/internal/ccsmp/lib/licenses.txt old mode 100644 new mode 100755 index 7390376..38806c8 --- a/internal/ccsmp/lib/licenses.txt +++ b/internal/ccsmp/lib/licenses.txt @@ -280,806 +280,146 @@ licence Solace ------ -Version: 04/01/2020 - -SOLACE CORPORATION - -LICENCE AGREEMENT FOR SOLACE SOFTWARE - -THIS LICENCE AGREEMENT and any documents expressly referred to in this -agreement (the "Agreement") between SOLACE CORPORATION, a company -incorporated under the laws of the Province of Ontario ("SOLACE") and -licensee, the party identified in the Order (as defined below) or that -otherwise accepts this Agreement (the "Licensee") (together the "Parties", -and each a "Party"), is made on the Effective Date (as defined below). - -BY ACCEPTING THE TERMS OF THIS AGREEMENT, EITHER BY: A) ACCEPTING THE AGREEMENT -ONLINE, B) SIGNING THE ORDER (AS DEFINED BELOW) WHICH REFERENCES THIS -AGREEMENT, OR C) INSTALLING OR USING THE SOFTWARE AFTER BEING MADE AWARE OF -THIS AGREEMENT, THE LICENSEE ACKNOWLEDGES THAT IT HAS READ AND UNDERSTOOD ALL -OF THE PROVISIONS, AND HAS THE AUTHORITY TO AGREE TO, AND IS CONFIRMING THAT IT -IS AGREEING TO, COMPLY WITH AND BE BOUND BY, ALL OF THE TERMS AND CONDITIONS -CONTAINED HEREIN, TOGETHER WITH THE TERMS SET FORTH IN ANY ORDER. IF, AFTER -READING THIS AGREEMENT, THE LICENSEE DOES NOT ACCEPT OR AGREE TO THE TERMS AND -CONDITIONS CONTAINED HEREIN, THE LICENSEE SHALL NOT INSTALL OR USE THE -SOFTWARE. - -IF YOU ARE AN AGENT OR EMPLOYEE OF ANOTHER ENTITY THEN YOU HEREBY REPRESENT AND -WARRANT THAT: (I) THE INDIVIDUAL ACCEPTING THIS AGREEMENT IS DULY AUTHORIZED TO -ACCEPT THIS AGREEMENT ON SUCH ENTITY'S BEHALF AND TO BIND SUCH ENTITY, AND -(II) SUCH ENTITY HAS FULL POWER, CORPORATE OR OTHERWISE, TO ENTER INTO THIS -AGREEMENT AND PERFORM ITS OBLIGATIONS HEREUNDER. - -1 INTERPRETATION - -1.1 Definitions. In this Agreement the following terms shall have the following -meanings: - -"Core" means (i) a single physical processor core or hyper-thread when -Solace PubSub+ software is deployed on either a bare-metal server or a cloud or -virtualization environment that presents physical cores to the software, and -(ii) a single virtual core when deployed in a cloud or virtualization -environment that presents virtual cores to the VMR. - -"Documentation" means the documentation made accessible by SOLACE via a -URL provided to Licensee. - -"Order" means (i) an electronic form provided by SOLACE on its website -for ordering Software Subscriptions, Professional Services, and/or Support and -Maintenance Services, or (ii) a written document, including a Licensee purchase -order, executed by SOLACE and Licensee pursuant to which Licensee purchases of -Software Subscriptions, Professional Services, and/or Support and Maintenance -Services from SOLACE. - -"Products" means the Software, Documentation, Support and Maintenance -Services, Professional Services and other products and services that are -ordered by Licensee from SOLACE. - -"Software" means the SOLACE software product(s) described in an Order. - -"SOLACE Quotation" means SOLACE's sales quotation document provided by -SOLACE to a prospective customer which sets out the fees for SOLACE's -Products. - -"Subscription" means the right granted by SOLACE to Licensee to install -and use the Software in accordance with the terms of this Agreement and the -applicable Order, for the Subscription Term specified in the applicable Order. - -"Subscription Fee" means the fee payable by Licensee for a Subscription -in accordance with the terms hereof and the applicable Order. - -"Subscription Term" means the period of time that Licensee is authorized -by SOLACE to install and use the Software (including the Documentation). - -"Support and Maintenance Services" means the support services provided by -SOLACE for the Software in accordance with the Support and Maintenance Terms. - -"Support and Maintenance Terms" means SOLACE'S policies, terms and -conditions for the provision of Support and Maintenance Services to its -customers, a copy of which is available on the SOLACE website at -https://solace.com/support. - -"Statement of Work" or "SOW" shall mean a statement of work in the -form attached hereto as Schedule B pursuant to which the parties agree upon the -Professional Services to be provided by SOLACE to Licensee, the fees to be -charged, milestones, deliverables and such other terms and conditions as the -parties may agree upon. - -1.2 Currency. Unless otherwise specified, all dollar amounts in this Agreement, -including the symbol "$", refer to United States currency. - -2 LICENSE GRANT - -2.1 General License to Software. - -(a) Provided Licensee complies with this Agreement, SOLACE hereby grants to -Licensee a non-exclusive, non-sublicensable (except as permitted in accordance -with Section 2.6 below), non-transferable, license, during the term of this -Agreement, to install and use the Software in object code form during the -applicable Subscription Term for the number of Cores specified in the Order, -solely for the Licensee's internal business purposes and in accordance with -the terms of this Agreement. - -(b) If Licensee requires a license from SOLACE to enable Licensee to bundle or -otherwise make available a Product with Licensee's own software, such -bundling will be pursuant to separate terms to be agreed. - -2.2 Documentation. Provided Licensee complies with this Agreement, Licensee may -reproduce the Documentation, for use on an internal basis only, and solely in -support of the Licensee's licensed use of the Software. Distribution of the -Documentation outside of Licensee is prohibited without the express written -permission of SOLACE. Licensee must reproduce all copyright and other -proprietary notices that are on the original copy of the Documentation. - -2.3 Back-up Copy. In addition to the number of copies of the Software -installed and used pursuant to Section 2.1 and paid for in accordance with -Section 5, Licensee may make one copy of each licensed Product per Subscription -solely for back-up purposes, provided that Licensee reproduces all copyright -and other proprietary notices that are on the original copy of the Software and -such back-up copy is not installed or used other than for back-up and recovery -purposes. Back-up copies that are used as part of a live or 'hot' -back-up will be subject to additional fees. - -2.4 Use Restrictions Licensee will not: (a) reverse engineer, disassemble, -decompile, or translate the Software (other than Sample Applications), or -otherwise attempt to derive the source code version of the Software, except if -and only to the extent expressly permitted by applicable law, and provided that -Licensee first approaches SOLACE and seeks permission in writing; (b) except as -expressly permitted in this Agreement, rent, lease, loan or otherwise in any -manner provide, transfer or distribute the Products or any part thereof to any -third party; (c) use the Software in violation of applicable laws; -d) circumvent any user limits or other license timing or use restrictions that -are built into the Software; (e) except as expressly permitted in this -Agreement, reproduce, distribute, publicly perform, publicly display or create -adaptations or derivative works of or based on the Products. - -2.5 Publicly Available Software. Portions of the Software include software -programs that are distributed by SOLACE pursuant to the terms and conditions of -a license granted by the copyright owner of such software programs and which -governs Customer's use of such software programs ("Publicly Available -Software"). The Licensee's use of Publicly Available Software in -conjunction with the Software in a manner consistent with the terms of this -Agreement is permitted, however, the Licensee may have broader rights under the -applicable license for Publicly Available Software and nothing contained herein -is intended to impose restrictions or limitations on the Licensee's use of -the Publicly Available Software. The warranty, indemnity and limitation of -liability provisions in this Agreement will apply to all of the Software, -including Publicly Available Software included in the Software. Copies of such -Publicly Available Software license agreements are available by contacting -Licensor at support@solace.com. The source code for certain portions of the -Publicly Available Software included in the Software (as specified in the -copyright notices) is available by contacting SOLACE at support@solcae.com -within a three (3) year period from the original date of receipt of the -applicable Software or Adapter and for a fee that shall not exceed Licensor' -costs associated with the shipping of such software source code. - -2.6 Sub-licensing. Any sub-licensing of the Software under this Agreement must -be expressly authorized by SOLACE pursuant to an Order or otherwise in writing. -Any attempt by Licensee to sub-license or otherwise transfer the Products to a -third party in breach of this restriction will be void. Any sub-licensing that -may be permitted under this Agreement by SOLACE will be subject to such -sub-licensee agreeing to substantially similar restrictions and obligations set -out in this Agreement. Licensee will be fully liable for any breach by a -sub-licensee of any restriction or obligation, and SOLACE may bring a Claim -against Licensee if SOLACE suffers any Losses arising from such breach. - -2.7 Evaluation Licenses. - -(a) If the Software provided to Licensee under this Agreement is designated by -SOLACE in an Order or otherwise as an evaluation release (indicated by terms -such as "pre-commercial", "alpha," "beta," "trial," -"draft," "early access," "EA" or "evaluation") (each an -"Evaluation Software Release"), Licensee will have the limited right -under this Agreement to download and install the Software on the number of -Cores identified in the Order or, if not identified, one Core, for the -Licensee's internal and non-commercial evaluation of the Software. - -(b) Licensee acknowledges that the Evaluation Software Release may not meet -performance and compatibility standards of a production version. The Evaluation -Software Release may not operate correctly, may be substantially modified by -SOLACE prior to first commercial shipment, and may be withdrawn completely and -never issued for commercial use. - -(c) If Licensee desires other rights for the Evaluation Software Release, -Licensee must request from SOLACE a commercial release of the Software. - -(d) The limited use license granted in subsection (a) will automatically expire -on the earlier of: (i) the date when the Software is made available to Licensee -as a commercially available product, and (ii) the date specified in the Order -or, if no such date is identified in the Order, the date that is 30 days after -the date of delivery or provision of the Evaluation Software Release to -Licensee. Following license expiry Licensee will permanently delete or -otherwise purge such Evaluation Software Release from Licensee's systems -and, if requested by SOLACE, certify the same. - -2.8 License of APIs. Provided Licensee complies with this Agreement and any -terms that SOLACE provides, SOLACE grants to Licensee a non-exclusive, royalty -free license, during the term of this Agreement, to download, install and use, -the applicable application programming interfaces that may be made available by -SOLACE with the Software ("APIs") solely to create interfaces between the -Software and the Licensee's software or third party software on -Licensee's systems. - -2.9 License to Sample Applications. - -(a) SOLACE may, in its sole discretion, provide certain sample Software in -source code or object code form for the purposes of demonstrating certain -features enabled by the Software, including demonstrating to Licensees how to -build applications using APIs, and for use by Licensees with such APIs (each, a -"Sample Application"). - -(b) Whether provided separately or together with other Software, if SOLACE -provides such Sample Application to Licensee, then SOLACE hereby grants to -Licensee a non-sublicensable, non-transferable, non-exclusive, revocable -license, to install such Sample Application for Licensee's evaluation for -the same duration as the Software with which the Sample Application is -associated or such other duration as specified by SOLACE upon delivery of the -Sample Application. - -3 OPTIONAL SERVICES AND SUPPORT - -3.1 Optional Services. Licensee acknowledge that certain optional services, -such as training, integration and development services may be provided by -SOLACE in association with the Products, and access to such services will be -provided only pursuant to a Statement of Work executed by SOLACE and Licensee -and may include separate and additional fees. - -3.2 Support. - -(a) Provided Licensee complies with this Agreement, SOLACE will provide Support -and Maintenance Services the Software in accordance with SOLACE's then -standard Support and Maintenance Terms. The level of support will be dependent -on whether Licensee has procured either the 'Premium Support Plan' or -'Standard Support Plan' defined in SOLACE's Support and Maintenance -Terms and as specified in the applicable Order. - -(b) SOLACE may enhance such standard Support and Maintenance Services from time -to time in its discretion. - -(c) For greater clarity, SOLACE's then standard Support and Maintenance -Terms do not apply to Evaluation Software Releases, Sample Applications or any -free versions of the Software that may be made available. SOLACE may make -available support related information on a free basis for such Software on its -publicly accessible website or otherwise, and such support related information -will, for greater clarity, be subject to the limitations and exclusions in this -Agreement. - -4 PROPRIETARY RIGHTS - -4.1 Intellectual Property Rights. In this Agreement "Intellectual Property -Rights" means: (a) any and all proprietary rights anywhere in the world -provided under: (i) patent law; (ii) copyright law (including moral rights); -(iii) trademark law; (iv) design patent or industrial design law; or (v) any -other statutory provision or common law principle applicable to this Agreement, -including trade secret law, that may provide a right in either hardware or -information generally or the expression or use of such hardware or information; -(b) any and all applications, registrations, licenses, sub-licenses, -franchises, agreements or any other evidence of a right in any of the -foregoing. Except for the licenses expressly granted herein, othing in this -Agreement or the provision of the Products conveys or otherwise provides to -Licensee title, interest or any Intellectual Property Rights in or to: (a) the -Products, or (b) know-how, ideas, or any other subject matter protectable under -laws applicable to Intellectual Property Rights of any jurisdiction. As between -Licensee and SOLACE, SOLACE and its affiliates and licensors are the sole and -exclusive owners of the Products, including Intellectual Property Rights -therein. - -4.2 Feedback. Licensee is encouraged to provide to SOLACE suggestions, -comments and feedback related to the Products (including reporting bugs) (the -"Feedback"). Licensee hereby grants to SOLACE a license to use, copy, -distribute, modify or otherwise adapt, incorporate into any software and -documentation, including the Products, and sublicense, without attribution or -compensation to Licensee, all Feedback which SOLACE receives or otherwise -obtains from Licensee, in any form, to improve, enhance or modify the Products -or otherwise. Licensee waives or will cause all moral rights to be waived in -any Feedback. - -4.3 Third Party Licenses. The Software may contain or require third party -software that is licensed under third party terms. SOLACE may direct Licensee -to such third party terms, and in some instances the Software cannot be used or -further distributed without Licensee's acceptance of such terms. Any -failure of Licensee to agree to the terms applicable to such third party -software may undermine certain functionality of or prevent Licensee from using -the Software. - -4.4 Open Source Software. - -(a) Licensee will not represent to third parties, or use any third party -software or code in conjunction with: (i)the Software; or (ii)any software, -products, documentation, content or other materials developed using the -Software, in such a way that: (A) creates, purports to create or has the -potential to create, obligations for SOLACE with respect to the Software; or -(B) grants, purports to grant, or has the potential to grant to any third party -any rights to or immunities under any Intellectual Property Rights of SOLACE, -as such rights exist in or relate to the Products. - -(b) Licensee will not use any Software in any manner, including through -incorporation, linking, distribution or otherwise, that will cause any Products -and any Intellectual Property Rights therein to become subject to any -encumbrance or terms and conditions of any third party or open source license, -including any open source license listed on -http://www.opensource.org/licenses/alphabetical (each an "Open Source -License"). - -(c) The restrictions, limitations, exclusions and conditions referred to under -subsection (b) will apply even if SOLACE becomes aware of or fails to act in a -manner to address any violation or failure to comply therewith. No act by -SOLACE that is undertaken under this Agreement in respect to any Products will -be construed as intending to cause any Intellectual Property Rights that are -owned or controlled by SOLACE or any of its affiliates (or for which SOLACE or -any of its affiliates has received license rights) to become subject to any -encumbrance or terms and conditions of any Open Source License. - -4.5 Use of Name and Logo Licensee will not display or make any use of -SOLACE's or its affiliates' names, marks or logos without the prior -written approval of SOLACE. - -5 FEES AND TAXES - -5.1 Fees. Licensee shall pay the applicable Subscription Fees and support fees -specified in the applicable Order. Except as otherwise specified herein or in -an Order, Subscription Fees are based on Subscriptions purchased and not -actual usage. Subscription Fees paid are refundable if the number of -Subscriptions purchased are decreased during the relevant Subscription Term. - -5.2 Invoices and Payment. Subscription Fees will be invoiced in advance and -otherwise in accordance with the relevant Order. All invoices issued by SOLACE -are due and payable within 30 days of the invoice date unless otherwise agreed -in an Order. Licensee will be responsible for any and all sales, use, excise, -import, value-added, services, consumption, and other taxes assessed on the -receipt of the Products, and any related services as a whole. - -5.3 Overdue Charges. Any payment not received from Customer by the due date may -accrue (except with respect to charges then subject to a reasonable and good -faith dispute), at Licensor' discretion, late charges at the rate of 1.5% of -the outstanding balance per month (19.57% per annum), or the maximum rate -permitted by law, whichever is lower, from the date such payment was due until -the date paid. - -6 CONFIDENTIALITY - -6.1 Definition of Confidential Information. - -In this Agreement "Confidential Information" of a Party means any -information of a Party (including in respect to SOLACE any of its affiliates, -licensors, customers, employees or subcontractors) (the "Disclosing -Party"), whether oral, written or in electronic form, which has or will come -into the possession or knowledge of the other Party (the "Receiving -Party") in connection with or as a result of entering into this Agreement -that can reasonably be considered to be confidential in the circumstances of -disclosure or which is designated as confidential. The Products, any -performance information, service levels, support terms, and results of testing -of the Software, and the terms of this Agreement are Confidential Information -of SOLACE. Notwithstanding the foregoing, "Confidential Information" does -not include information that is: - -(a) publicly available when it is received by or becomes known to the Receiving -Party or that subsequently becomes publicly available other than through a -direct or indirect act or omission of the Receiving Party (but only after it -becomes publicly available); - -(b) established by evidence to have been already known to the Receiving Party -at the time of its disclosure to the Receiving Party and is not known by the -Receiving Party to be the subject of an obligation of confidence of any kind; - -(c) independently developed by the Receiving Party without any use of or -reference to the Confidential Information of the Disclosing Party as -established by evidence that would be acceptable to a court of competent -jurisdiction; - -(d) received by the Receiving Party in good faith without an obligation of -confidence of any kind from a third party who the Receiving Party had no reason -to believe was not lawfully in possession of such information free of any -obligation of confidence of any kind, but only until the Receiving Party -subsequently comes to have reason to believe that such information was subject -to an obligation of confidence of any kind when originally received; or - -(e) Feedback provided by Licensee or a representative of Licensee. - -6.2 Confidentiality Obligations. - -(a) Each Party will, in its capacity as a Receiving Party: (i) not use or -reproduce Confidential Information of the Disclosing Party for any purpose, -other than as may be reasonably necessary for the exercise of its rights or the -performance of its obligations set out in this Agreement; and (ii) not -disclose, provide access to, transfer or otherwise make available any -Confidential Information of the Disclosing Party to any third party except as -expressly permitted in this Agreement. - -(b) Each Party may, in its capacity as a Receiving Party, disclose Confidential -Information of the Disclosing Party: (i) if and to the extent required by a -governmental authority or otherwise as required by applicable law, provided -that the Receiving Party must first give the Disclosing Party notice of such -compelled disclosure (except where prohibited by applicable law from doing so) -and must use commercially reasonable efforts to provide the Disclosing Party -with an opportunity to take such steps as it desires to challenge or contest -such disclosure or seek a protective order. Thereafter, the Receiving Party -may disclose the Confidential Information of the Disclosing Party, but only to -the extent required by applicable law and subject to any protective order that -applies to such disclosure; and (ii) to: (A) its accountants, internal and -external auditors and other professional advisors if and to the extent that -such persons need to know such Confidential Information in order to provide the -applicable professional advisory services relating to the Receiving Party; and -(B) employees of the Receiving Party and its subcontractors if and to the -extent that such persons need to know such Confidential Information to perform -their respective obligations under this Agreement; - -provided that any such person is aware of the provisions of this Section 6.2 -and has entered into a written agreement with the Receiving Party that includes -confidentiality obligations in respect of such Confidential Information of the -Disclosing Party that are no less stringent than those contained in this -Section 6.2. - -6.3 Consent to Injunctive Relief. Any unauthorized use or disclosure of the -Confidential Information of SOLACE, its affiliates or licensors may cause -irreparable harm and significant injury to SOLACE that would be difficult to -ascertain or quantify; accordingly Licensee agrees that SOLACE will have the -right to seek and obtain injunctive or other equitable relief to enforce the -terms of this Agreement and without limiting any other rights or remedies that -SOLACE may have. - -7 WARRANTY AND DISCLAIMER OF WARRANTIES. - -7.1 Warranty. SOLACE warrants that the Software will materially comply with -the Documentation during the Subscription Term. If the Software does not -materially conform with the warranty in the prior sentence, provided that -Licensee is in compliance with the terms of this Agreement, and all -Subscription Fees are fully-paid up, SOLACE will provide the support to -Licensee in respect to the applicable Software to the extent set out in -SOLACE's then current Support and Maintenance Terms, and the provision of -support to correct the non-compliance with the warranty in this Section will be -Licensee's sole and exclusive remedy in the event of non-compliance with the -warranty in this Section by SOLACE. All other support will be dependent on the -plan procured by Licensee, as defined in the Support and Maintenance Terms. - -7.2 Disclaimers. - -(a) EXCEPT AS SET OUT IN SECTION 7.1, THE PRODUCTS AND SUPPORT THAT MAY BE -PROVIDED BY SOLACE UNDER THIS AGREEMENT, IS PROVIDED 'AS-IS' AND 'AS -AVAILABLE'. - -(b) Except as set out in Section 7.1, the Products and support are without any -additional warranties of any kind, whether express, implied, collateral, -statutory or otherwise. SOLACE does not warrant or make any representations -regarding the use, or the results of the use, of the Products in terms of its -correctness, accuracy, reliability, or otherwise. - -(c) SOLACE does not represent or warrant that the functionality of the Products -will meet Licensee requirements, or that the operation of the Products will be -uninterrupted or error-free, or that the Products or any service enabled by -the use of the Software will always be available, or that defects in the -Products will be corrected. - -(d) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAW, SOLACE ON ITS OWN -BEHALF AND ON BEHALF OF ITS AFFILIATES AND LICENSOR(S) EXPRESSLY DISCLAIMS ALL -WARRANTIES AND CONDITIONS, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, -INCLUDING ANY IMPLIED WARRANTIES, AND CONDITIONS OF MERCHANTABLE QUALITY, -MERCHANTABILITY, QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND -NON-INFRINGEMENT. - -(e) Some jurisdictions do not allow the exclusion of implied warranties, so -exclusions in this Article 7 will apply only to the extent permitted by -applicable law. - -8 LICENSEE INDEMNITY AND EXCLUSION. - -8.1 Licensee Indemnity. - -(a) Without limiting SOLACE's rights and remedies under this Agreement, -Licensee will indemnify, defend and hold SOLACE, its licensors, affiliates or -any of their respective directors, officers, employees or agents (together, the -"Solace Indemnitees") harmless from and against any and all third party -Claims and Losses incurred or otherwise suffered by each SOLACE Indemnitee -arising out of, resulting from or related to: -(i) any use, reproduction or distribution of the Products (notwithstanding the -restrictions and obligations in this Agreement), as modified or integrated by -Licensee in Licensee application, which causes an infringement or -misappropriation of any Intellectual Property Right, publicity or privacy right -of any third parties arising in any jurisdiction anywhere in the world, except -and solely to the extent such infringement is caused by the unmodified -Software, or portions thereof, as supplied to Licensee by SOLACE under this -Agreement; or -(ii) any use, downloading, distribution, installation, storage, execution, or -transfer of the Products in breach of this Agreement. - -(b) SOLACE may enforce the indemnity under this Article 8 on behalf of any or -all of the SOLACE Indemnitees. Licensee may only bring a Claim against SOLACE -and not any SOLACE Indemnitees under this Agreement. - -8.2 SOLACE Indemnity. - -(a) SOLACE will defend Licensee from and against any and all Claims by a third -party incurred or otherwise suffered by Licensee arising out of, resulting from -or related to a Claim that the Products licensed pursuant to Section 2.1 -infringe or misappropriate third party copyright or patent rights in Canada or -the United States of America, and indemnity Licensee from any damages awarded -by a court of final determination. - -(b) Without limitation, Section 8.2 will not be applicable and SOLACE will not -be liable to defend a Claim to the extent that such Claim is based on: (i) -Licensee's use of the Products after SOLACE notifies Licensee to discontinue -using them; (ii) Licensee combining the Products with non-SOLACE services, -products, programs or data; or (iii) Licensee altering or modifying the -Products. - -(c) If SOLACE receives information concerning an infringement or -misappropriation Claim related to the Products, SOLACE may, at its expense and -without obligation to do so, either: (i) procure the Intellectual Property -Rights or other right(s) to continue to use the Product; or (ii) replace or -modify the Product to make it non-infringing; or (iii) immediately terminate -this Agreement on written notice to Licensee, in which case SOLACE will refund -to Licensee, on a pro-rata basis, any pre-paid fees in respect to such Product -from the date of such termination to the end of the then current Subscription -Term for such Product; and this Section 8.2(c) states the sole and exclusive -remedy of Licensee and the entire liability of SOLACE for third party -infringement claims and actions. - -8.3 Indemnification Procedures. Each Party's obligations under this Article -8 are contingent on all of the following: (i) the Party seeking the indemnity -(the "Indemnified Party") must notify the other Party (the -"Indemnifying Party"), in a timely manner and in writing of the Claim; -(ii) the Indemnified Party must give the Indemnifying Party sole control over -defense and settlement of the Claim; (iii) the Indemnified Party must provide -the Indemnifying Party with reasonable information and assistance, at the -Indemnifying Party's request, as needed in defending the Claim (the -Indemnifying Party will reimburse the Indemnified Party for reasonable expenses -that the Indemnified Party incurs in providing that assistance). The -Indemnified Party may choose to have its counsel, monitor or participate in the -defense of such a Claim provided that the Indemnified Party will be responsible -for the cost of its own counsel and the Indemnifying Party's obligations in -this Article 8 do not extend to the Indemnified Party's legal costs should -it wish to exercise such right. The Indemnifying Party will not be responsible -for any settlement made by the Indemnified Party without its prior written -consent. The Indemnifying Party may not settle or publicize any Claim without -the Indemnified Party's prior written consent. - -9 LIMITATIONS OF LIABILITY. - -9.1 Definition and Limitations of Liability. - -(a) In this Agreement: "Claim" means any actual, threatened or potential -civil, criminal, administrative, regulatory, arbitral or investigative demand, -allegation, action, suit, investigation or proceeding or any other claim or -demand; and "Losses" means any and all damages, fines, penalties, -deficiencies, losses, liabilities (including settlements and judgments), costs -and expenses (including interest, court costs, reasonable fees and expenses of -lawyers, accountants and other experts and professionals or other reasonable -fees and expenses of litigation or other proceedings or of any Claim, default -or assessment). - -(b) SUBJECT TO SECTION 9.1(d), TO THE FULLEST EXTENT PERMITTED BY APPLICABLE -LAW, UNDER NO CIRCUMSTANCES WILL SOLACE INDEMNITEES BE LIABLE FOR (A) ANY -INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, EXEMPLARY OR CONSEQUENTIAL DAMAGES; OR -(B) ANY DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, OR LOSS OF -BUSINESS INFORMATION, IN EACH CASE, ARISING OUT OF OR IN CONNECTION WITH THIS -AGREEMENT, INCLUDING ANY DOWNLOAD, INSTALLATION OR USE OF, OR INABILITY TO USE, -THE PRODUCTS; EVEN IF SUCH DAMAGES WERE FORESEEABLE, AND REGARDLESS OF WHETHER -THE SOLACE INDEMNITIEES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -(c) SUBJECT TO SECTION 9.1(d), TO THE FULLEST EXTENT PERMITTED BY APPLICABLE -LAW, IN NO EVENT WILL SOLACE INDEMNITEES' TOTAL AGGREGATE LIABILITY IN -RESPECT OF THIS AGREEMENT, INCLUDING THE PRODUCTS AND ANY SERVICES THAT MAY BE -PROVIDED HEREUNDER, FOR ANY AND ALL LOSSES AND CLAIMS EXCEED THE AMOUNTS PAID -TO SOLACE IN THE 12 MONTHS IMMEDIATELY PRECEDING THE EVENT GIVING RISE TO THE -CLAIM. - -(d) Certain Damages Not Excluded or Limited. NOTWITHSTANDING THE FOREGOING, -SECTIONS 9.1 (b) AND (c) DO NOT APPLY TO (I) DAMAGES ARISING FROM A PARTY'S -BREACH OF ITS CONFIDENTIALITY OBLIGATIONS HEREUNDER, (II) INDEMNIFICATION -CLAIMS, (III) DAMAGES ARISING FROM INFRINGEMENT OF A PARTY'S INTELLECTUAL -PROPERTY RIGHTS; (IV) ANY CLAIMS FOR NON-PAYMENT, (V) FRAUD OR WILLFUL -MISCONDUCT, OR (VI) BODILY INJURY OR DEATH. - -(e) This Article 9 will apply irrespective of the nature of the cause of -action, demand or Claim, including, breach of contract (including fundamental -breach), negligence (including gross negligence), tort or any other legal -theory, and will survive a fundamental breach or breaches of this Agreement or -of any remedy contained herein. - -10 TERM AND TERMINATION. - -10.1 Term and Renewal. This Agreement will be effective from the Effective Date -and will continue until the expiry of the Subscription Term set out in the -Order or the Agreement terminates in accordance with its terms. Subject to -payment of the applicable Software Fees, Software Subscriptions shall -automatically renew for additional periods equal to the expiring Subscription -Term or one (1) year (whichever is shorter), unless either party gives the -other notice of non-renewal at least thirty (30) days prior to the end of the -then-current Subscription Term. The Subscription Fees during any automatic -renewal term will be as set forth in the applicable Order. - -10.2 Termination for Cause. A party may terminate this Agreement for cause (i) -upon 30 days' written notice to the other party of a material breach if such -breach remains uncured at the expiration of such period, or (ii) if the other -party becomes the subject of a petition in bankruptcy or any other proceeding -relating to insolvency, receivership, liquidation or assignment for the benefit -of creditors. - -10.3 Termination by SOLACE. SOLACE may terminate this Agreement for cause with -immediate effect on written notice if Licensee commits a breach of Articles 4 -or 5 by Licensee. - -10.4 Termination of Sample Application and Evaluation Software Release Licenses -for Convenience by SOLACE. SOLACE may terminate the licenses in respect to the -Sample Applications, Evaluation Software Releases, and any other Products that -may be licensed by SOLACE on a trial basis, at any time for convenience, upon -written notice to Licensee. - -10.5 Termination of Licenses of Trial Software. Subject to Section 10.4, if any -Software is licensed for use by a Licensee on a trial basis, the license to use -such Software during a trial period will continue for such duration set out in -an Order. - -10.6 Effects of Termination. Upon termination or expiry of this Agreement or -specific licenses granted hereunder for any reason, and without limiting -SOLACE's other rights or remedies under this Agreement: (a) Licensee must -permanently delete or destroy, or otherwise purge, all copies (electronic or -otherwise) of the applicable Products from Licensee's systems, and any other -Confidential Information of SOLACE, in Licensee's possession or control, -and, if requested by SOLACE, certify the same, and the license and other rights -granted to Licensee in this Agreement will terminate; (b) termination or -expiration of this Agreement or an individual Subscription will result in -termination of any applicable Support and Maintenance Services; and (c) -Licensee will not receive a return of any pre-paid fees in respect to the -applicable Products, on a pro-rata basis or otherwise, except where expressly -stated in this Agreement. - -10.7 Survival. Neither the expiration nor the earlier termination of this -Agreement will release either of the Parties from any obligation or liability -that accrued prior to such expiration or termination. The provisions of this -Agreement requiring performance or fulfilment after the expiration or earlier -termination of this Agreement, including Articles 4, 5, 7, 8, 9, 10, 11, 12, -and 13, and such other provisions as are necessary for the interpretation -thereof and any other provisions hereof, the nature and intent of which is to -survive termination or expiration of this Agreement, will survive the -expiration or earlier termination of this Agreement. - -11 AUDIT AND REMEDIATION - -11.1 Audit. During the term of this Agreement and for two years thereafter, -SOLACE or any internal or external audit representative acting on behalf of -SOLACE (the "SOLACE Audit Representatives") will have the right, and -Licensee will provide access to SOLACE Audit Representatives during regular -business hours and upon reasonable prior written notice to Licensee, to audit -and inspect on a mutually agreed upon date and location any system or facility -or part of a system or facility to which Licensee has downloaded the Software -or is receiving any services (or both) in order to verify the performance by -Licensee of its obligations under this Agreement, including the Licensee's -usage of the Products in accordance with the restrictions and terms in this -Agreement. - -11.2 Remediation. Without limiting SOLACE's rights and remedies under this -Agreement, if an audit conducted pursuant to this Agreement reveals any error, -deficiency or other failure to perform on the part of Licensee including use of -the Software contrary to the licenses in this Agreement or installed on -systems, computers or processors for which the Licensee has not paid applicable -Subscription Fees: (a) Licensee will immediately pay to SOLACE any fees due and -payable for Software used in breach of the restrictions in this Agreement, plus -interest at the lesser of: (i) the rate of 1.5 percent per month compounded -monthly (19.562 percent per annum); or (ii) the maximum rate allowed by -applicable law, in each case, on the amount outstanding from the date when -payment is due until the date payment in full is received by SOLACE; and (b) -pursue any other right or remedy SOLACE may have under this Agreement. - -12 EXPORT COMPLIANCE ASSURANCES - -(a) All Products obtained from SOLACE are subject to the export control and -economic sanctions laws and regulations of Canada, including the Exports and -Import Permits Act, R.S.C. 1985, c. E-19, Area Control List, Export Control -List, and the United States, including the Export Administration Regulations -("EAR", 15 CFR 730 et seq., http://www.bis.doc.gov/) administered by the -Department of Commerce, Bureau of Industry and Security, and the Foreign Asset -Control Regulations (31 CFR 500 et seq., -http://www.treas.gov/offices/enforcement/ofac/) administered by the Department -of Treasury, Office of Foreign Assets Control ("OFAC"), each as may be -amended and updated from time to time. - -(b) Licensee will not, and will ensure that Licensee will not directly or -indirectly export, re-export, transfer or release (collectively, -"export") any Products to any destination, person, entity or end use -prohibited or restricted under Canadian or US law, or the laws of the -jurisdiction in which Licensee is resident or in which Licensee uses the -Products, without prior government or regulatory authorization to the extent -required by applicable laws and regulations. - -(c) The US government maintains embargoes and sanctions against the countries -listed in Country Groups E:1/2 of the EAR (Supplement 1 to part 740), -including, as at the Effective Date, Cuba, Iran, North Korea, Sudan and Syria, -as amended from time to time. Licensee will not directly or indirectly employ -any Product received from SOLACE in missile technology, sensitive nuclear or -chemical biological weapons activities, or in any manner knowingly transfer any -Product to any party for any such end use. Licensee will not export Products -listed in Supplement 2 to part 744 of the EAR for military end-uses, as defined -in part 744.21, to the People's Republic of China. Licensee will not -transfer any Product to any party listed on any of the denied parties lists or -specially designated nationals lists maintained under said regulations without -appropriate US government authorization to the extent required by regulation. -Licensee acknowledge that other countries may have trade laws pertaining to -import, use, export or distribution of Products, and that compliance with same -is Licensee responsibility. - -(d) Licensee may not use the Products if Licensee is barred from receiving the -Products under the laws of Canada, the United States or any other country -including the country in which Licensee are resident or in which Licensee use -the Products. - -13 GENERAL - -13.1 U.S. Government Users. If Licensee are acting on behalf of an agency or -instrumentality of the U.S. federal government, the Product, as applicable, are -"commercial computer software" and "commercial computer software -documentation" developed exclusively at private expense by SOLACE Pursuant -to FAR 12.212 or DFARS 227 7202 and their successors, as applicable, use, -reproduction and disclosure of the Products is governed by the terms of this -Agreement. - -13.2 Entire Agreement. This Agreement, and the agreements and other documents -required to be delivered pursuant to this Agreement, constitute the entire and -exclusive agreement between SOLACE and Licensee, and sets out all the -covenants, promises, warranties, representations, conditions and agreements -between the Parties in connection with the subject matter of this Agreement, -and supersedes all prior agreements (whether written or oral, pre-contractual -or otherwise) and other communications between SOLACE and Licensee. There are -no covenants, promises, warranties, representations, conditions or other -agreements, whether oral or written, pre-contractual or otherwise, express, -implied or collateral, whether statutory or otherwise, between the Parties in -connection with the subject matter of this Agreement except as specifically set -forth in this Agreement and any document required to be delivered pursuant to -this Agreement. - -13.3 Amendments. This Agreement may be modified only by a written amendment -agreed to by both Licensee and SOLACE, except that SOLACE may modify the -Documentation from time to time, provided that SOLACE does not materially -lessen the description of the functionality of the Products as a result of such -modification. - -13.4 English Language. This Agreement is entered into solely in the English -language, and if for any reason any other language version is prepared by any -Party, it will be solely for convenience and the English version will govern -and control in all respects If Licensee are located in the province of -Quebec, Canada, the following applies: The Parties hereby confirm they have -requested this Agreement and all related documents be prepared in English Les -parties ont exig� que le pr�sent contrat et tous les documents connexes soient -r�dig�s en anglais. - -13.5 Waiver. To be effective, any waiver by a Party of any of its rights or any -other Party's obligations under this Agreement must be made in a writing -signed by the Party to be charged with the waiver. No failure or forbearance -by any Party to insist upon or enforce performance by any other Party of any of -the provisions of this Agreement or to exercise any rights or remedies under -this Agreement or otherwise at law or in equity will be construed as a waiver -or relinquishment to any extent of such Party's right to assert or rely upon -any such provision, right, or remedy in that or any other instance; rather, the -same will be and remain in full force and effect. A Party's waiver of a -breach of any term will not be a waiver of any subsequent breach of the same or -another term. - -13.6 Cumulative Rights. The rights of each Party hereunder are cumulative and -no exercise or enforcement by a Party of any right or remedy hereunder will -preclude the exercise or enforcement by such Party of any other right or remedy -hereunder or which such Party is otherwise entitled by law to enforce. - -13.7 Severability. If, in any jurisdiction, any provision of this Agreement or -its application to any Party or circumstance is restricted, prohibited or -unenforceable, the provision will, as to that jurisdiction, be ineffective only -to the extent of the restriction, prohibition or unenforceability without -invalidating the remaining provisions of this Agreement and without affecting -the validity or enforceability of such provision in any other jurisdiction, or -without affecting its application to other Parties or circumstances. - -13.8 Assignment. SOLACE may assign this Agreement or any of the benefits, -rights or obligations under this Agreement without the prior written consent of -the Licensee. Licensee may not assign this Agreement or any of the benefits, -rights or obligations under this Agreement without the prior written consent of -SOLACE. Any attempt by Licensee to so assign or transfer is null and void. If -SOLACE does consent to an assignment of this Agreement, the transferee/assignee -must be acceptable to SOLACE and agree to the terms and conditions of this -Agreement. - -13.9 Further Assurances. The Parties will, with reasonable diligence, do all -things and provide all such reasonable assurances as may be required to -consummate the transactions contemplated by this Agreement, and each Party will -provide such further documents or instruments required by any other Party as -may be reasonably necessary or desirable to effect the purpose of this -Agreement and carry out its provisions. - -13.10 Governing Law and Jurisdiction. This Agreement is governed and -interpreted in accordance with the laws of the Province of Ontario and the laws -of Canada applicable therein, without giving effect to its conflict of laws -provisions. Any Claim arising out of or related to this Agreement must be -brought exclusively in a federal or provincial court located in Ottawa, Canada, -and Licensee hereby consents to the jurisdiction and venue of such courts. -Each of the Parties irrevocably waives, to the fullest extent it may -effectively do so, the defence of an inconvenient forum to the maintenance of -such action, application or proceeding. The Parties will not raise any -objection to the venue of any action, application, reference or other -proceeding arising out of or related to this Agreement in the federal or -provincial courts sitting in Ottawa, including the objection that the -proceedings have been brought in an inconvenient forum. A final judgment in -any such action, application or proceeding is conclusive and may be enforced in -other jurisdictions by suit on the judgment or in any other manner specified by -law. The United Nations Convention on Contracts for the International Sale of -Goods is expressly disclaimed and will not apply. +SOLACE API LICENSE AGREEMENT + +Version 1.1 + +This Solace API License Agreement Version 1.1 ("Agreement") sets forth the +terms and conditions on which Solace Corporation ("Solace") makes available +certain of its APIs (defined below). BY INSTALLING, DOWNLOADING, ACCESSING, OR +USING ANY OF THE APIs, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE APIs. IF +YOU ARE RECEIVING THE APIs ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND +WARRANT THAT YOU HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS +OF THIS AGREEMENT ON BEHALF OF SUCH ENTITY. + +"API" means a collection of routines, classes, function parameters, protocols, +tools, and software (including related libraries) created by Solace that allow +access to or interoperability with Solace products, as may be updated or +modified by Solace from time to time. + +"Application" means the software created or modified by the Licensee to enable +its product to access or otherwise interoperate with Solace products via an +API. + +"License" means the license granted in Section 1.1. + +"Licensee" means you, an individual, or the entity on whose behalf you are +receiving the Software. + +1 LICENSE GRANT AND CONDITIONS. + +1.1. License. Subject to the terms and conditions of this Agreement, Solace +hereby grants to Licensee a non-exclusive, royalty-free, worldwide, +non-transferable, non-sublicensable, license during the term of this Agreement +to (a) use APIs for the sole purpose of creating Applications including the +incorporation of API software into such Applications and (b) distribute such +Applications to its customers for the sole purpose of enabling interoperability +between Licensee products and Solace products. + +1.2. Conditions. In consideration of the License, Licensee's use and +distribution of Applications is subject to the following conditions: + +1.2.1. Licensee shall not use or attempt to use the APIs (a) in violation or +contravention of any applicable law, regulation or generally accepted practices + or guidelines in the relevant jurisdictions or (b) other than as expressly set +forth in this Agreement. + +1.2.2. Licensee acknowledges that future updates or modifications to the APIs +by Solace may: (a) remove or restrict previously existing functionality and/or +(b) require the Licensee to update or modify its Applications. + +1.2.3. In any distribution of the Applications, Licensee will retain and +reproduce in their entirety any Solace or third-party disclaimers, copyright +notices, licenses, and other proprietary notices provided with the APIs. +Licensee will ensure that any API software incorporated into the Application +will remain subject to the terms and conditions set out in this Agreement. + +1.2.4. Licensee shall not reverse engineer, disassemble, decompile, translate, +or otherwise attempt to derive the source code version of any API software +provided in object code form, except if and only to the extent expressly +permitted by applicable law, and provided that Licensee first approaches +Solace and seeks permission in writing. + +1.3. Publicly Available Software. The APIs may include software programs +that are distributed by Solace pursuant to the terms and conditions of a +license granted by the copyright owner of such software programs and which +governs Licensee's use of such software programs ("Publicly Available +Software"). The Licensee's use of Publicly Available Software in conjunction +with the APIs in a manner consistent with the terms of this Agreement is +permitted, however, the Licensee may have broader rights under the applicable +license for Publicly Available Software and nothing contained herein is +intended to impose restrictions or limitations on the Licensee's use of the +Publicly Available Software. + +2. TERM AND TERMINATION. + +This Agreement will commence upon Licensee's first use of an API and will +continue unless and until earlier terminated as set forth herein. If Licensee +breaches any of its conditions or obligations under this Agreement, this +Agreement and the License will terminate automatically and permanently. + +3. INTELLECTUAL PROPERTY. + +As between the parties, Solace will retain all right, title, and interest in +the APIs, and all intellectual property rights therein. Solace hereby reserves +all rights not expressly granted to Licensee in this Agreement. Solace hereby +reserves all rights in its trademarks and service marks, and no licenses +therein are granted in this Agreement. Subject to Solace's rights in the APIs, +Solace agrees that it obtains no right, title, or interest from the Licensee +under this Agreement in or to any Applications. + +4. DISCLAIMER. + +THE APIs ARE PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND. +SOLACE HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, +IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF +THIRD-PARTY INTELLECTUAL PROPERTY RIGHTS, WITH RESPECT TO THE APIs. + +5. LIMITATION OF LIABILITY. + +THE LICENSEE AGREES THAT SOLACE WILL HAVE NO LIABILITY WHATSOEVER FOR ANY USE +THE LICENSEE MAKES OF THE APIs. SOLACE WILL NOT BE LIABLE FOR ANY DAMAGES OF +ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, +SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL APPLY +TO THE EXTENT PERMITTED BY APPLICABLE LAW. + +6. GENERAL. + +6.1. Governing Law. This Agreement will be governed by and interpreted in +accordance with the laws of the Province of Ontario, without reference to its +conflict of laws principles. If Licensee is located within Canada, all disputes +arising out of this Agreement are subject to the exclusive jurisdiction of +courts located in Ottawa, Ontario, Canada. If Licensee is located outside of +Canada, any dispute, controversy, or claim arising out of or relating to this +Agreement will be referred to and finally determined by arbitration in +accordance with the JAMS International Arbitration Rules. The tribunal will +consist of one arbitrator. The place of arbitration will be Ottawa, Ontario, +Canada. The language to be used in the arbitral proceedings will be English. +Judgment upon the award rendered by the arbitrator may be entered in any court +having jurisdiction thereof. + +6.2. Assignment. Licensee is not authorized to assign its rights under this +Agreement to any third party. Solace may freely assign its rights under this +Agreement to any third party. + +6.3. Other. This Agreement is the entire agreement between the parties +regarding the subject matter hereof. No amendment or modification of this +Agreement will be valid or binding upon the parties unless made in writing and +signed by the duly authorized representatives of both parties. If any +provision, including without limitation any condition, of this Agreement is +held to be unenforceable, this Agreement and all licenses and rights granted +hereunder will immediately terminate. Waiver by Solace of a breach of any +provision of this Agreement or the failure by Solace to exercise any right +hereunder will not be construed as a waiver of any subsequent breach of that +right or as a waiver of any other right. + +- End - + +Version 1.1 +November 2, 2023 Zlib diff --git a/internal/ccsmp/lib/linux_amd64/dummy.go b/internal/ccsmp/lib/linux_amd64/dummy.go index 8b58163..664ffc5 100644 --- a/internal/ccsmp/lib/linux_amd64/dummy.go +++ b/internal/ccsmp/lib/linux_amd64/dummy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/lib/linux_amd64/libsolclient.a b/internal/ccsmp/lib/linux_amd64/libsolclient.a index d20ecb1..6b57942 100644 Binary files a/internal/ccsmp/lib/linux_amd64/libsolclient.a and b/internal/ccsmp/lib/linux_amd64/libsolclient.a differ diff --git a/internal/ccsmp/lib/linux_arm64/dummy.go b/internal/ccsmp/lib/linux_arm64/dummy.go index 7188dd8..84c25f6 100644 --- a/internal/ccsmp/lib/linux_arm64/dummy.go +++ b/internal/ccsmp/lib/linux_arm64/dummy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/ccsmp/lib/linux_arm64/libsolclient.a b/internal/ccsmp/lib/linux_arm64/libsolclient.a old mode 100755 new mode 100644 index 9f116b1..8dbdfef Binary files a/internal/ccsmp/lib/linux_arm64/libsolclient.a and b/internal/ccsmp/lib/linux_arm64/libsolclient.a differ diff --git a/internal/generator/generator_utils.go b/internal/generator/generator_utils.go index e60af40..371b1a8 100644 --- a/internal/generator/generator_utils.go +++ b/internal/generator/generator_utils.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import ( const copyrightHeader = `// pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/constants/constants.go b/internal/impl/constants/constants.go index 576936a..7d75a70 100644 --- a/internal/impl/constants/constants.go +++ b/internal/impl/constants/constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/constants/default_properties.go b/internal/impl/constants/default_properties.go index d08c283..6461a97 100644 --- a/internal/impl/constants/default_properties.go +++ b/internal/impl/constants/default_properties.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/constants/error_strings.go b/internal/impl/constants/error_strings.go index 98ade04..504e997 100644 --- a/internal/impl/constants/error_strings.go +++ b/internal/impl/constants/error_strings.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/error.go b/internal/impl/core/error.go index fdefb1c..240484a 100644 --- a/internal/impl/core/error.go +++ b/internal/impl/core/error.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/events.go b/internal/impl/core/events.go index 8e27a6c..f12fe38 100644 --- a/internal/impl/core/events.go +++ b/internal/impl/core/events.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/init.go b/internal/impl/core/init.go index be1af2f..79c007c 100644 --- a/internal/impl/core/init.go +++ b/internal/impl/core/init.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/log.go b/internal/impl/core/log.go index 0ea1a5a..54fd2e2 100644 --- a/internal/impl/core/log.go +++ b/internal/impl/core/log.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/metrics.go b/internal/impl/core/metrics.go index cec3b10..c2dfa29 100644 --- a/internal/impl/core/metrics.go +++ b/internal/impl/core/metrics.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/metrics_test.go b/internal/impl/core/metrics_test.go index 01b5a31..6a7afd9 100644 --- a/internal/impl/core/metrics_test.go +++ b/internal/impl/core/metrics_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/publisher.go b/internal/impl/core/publisher.go index 9840130..2fa9374 100644 --- a/internal/impl/core/publisher.go +++ b/internal/impl/core/publisher.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/publisher_test.go b/internal/impl/core/publisher_test.go index 8c2b2a9..9f08a8e 100644 --- a/internal/impl/core/publisher_test.go +++ b/internal/impl/core/publisher_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/receiver.go b/internal/impl/core/receiver.go index 6d9def6..d7e2925 100644 --- a/internal/impl/core/receiver.go +++ b/internal/impl/core/receiver.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/transport.go b/internal/impl/core/transport.go index baf269c..ddb43d2 100644 --- a/internal/impl/core/transport.go +++ b/internal/impl/core/transport.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/transport_test.go b/internal/impl/core/transport_test.go index dc1751b..01bb875 100644 --- a/internal/impl/core/transport_test.go +++ b/internal/impl/core/transport_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/core/version.go b/internal/impl/core/version.go index cea0204..1e9403d 100644 --- a/internal/impl/core/version.go +++ b/internal/impl/core/version.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/executor/executor.go b/internal/impl/executor/executor.go index 15bc913..76ccb0a 100644 --- a/internal/impl/executor/executor.go +++ b/internal/impl/executor/executor.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/executor/executor_test.go b/internal/impl/executor/executor_test.go index 31530c2..f0908f8 100644 --- a/internal/impl/executor/executor_test.go +++ b/internal/impl/executor/executor_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/future/future_error.go b/internal/impl/future/future_error.go index 303b442..f690555 100644 --- a/internal/impl/future/future_error.go +++ b/internal/impl/future/future_error.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/future/future_error_test.go b/internal/impl/future/future_error_test.go index 2d7f1a4..60d3b39 100644 --- a/internal/impl/future/future_error_test.go +++ b/internal/impl/future/future_error_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/logging/logging.go b/internal/impl/logging/logging.go index f03ba52..c065bfc 100644 --- a/internal/impl/logging/logging.go +++ b/internal/impl/logging/logging.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/logging/logging_test.go b/internal/impl/logging/logging_test.go index 8a9c406..f351b1d 100644 --- a/internal/impl/logging/logging_test.go +++ b/internal/impl/logging/logging_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/message/inbound_message_impl.go b/internal/impl/message/inbound_message_impl.go index 3fa5142..8259da4 100644 --- a/internal/impl/message/inbound_message_impl.go +++ b/internal/impl/message/inbound_message_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/message/message_impl.go b/internal/impl/message/message_impl.go index 2761ff8..6ed5b73 100644 --- a/internal/impl/message/message_impl.go +++ b/internal/impl/message/message_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -312,6 +312,214 @@ func (message *MessageImpl) GetClassOfService() int { return classOfService } +// GetCreationTraceContext will return the trace context metadata used for distributed message tracing message +// creation context information across service boundaries. +// It allows correlating the producer with the consumers of a message, regardless of intermediary +// instrumentation. It must not be altered by intermediaries. +// If the content is not accessible, an empty slice will be returned and the ok flag will be false. +func (message *MessageImpl) GetCreationTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) { + var traceIDErr, spanIDErr, sampledErr, traceStateErr core.ErrorInfo + ok = true // will remain true if we are able to retrieve all the trace context properties + // get the creation trace context properties + traceID, traceIDErr = ccsmp.SolClientMessageGetCreationTraceContextTraceID(message.messagePointer) + if traceIDErr != nil { + ok = false + if traceIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Creation Context traceID property: "+traceIDErr.GetMessageAsString()+", sub code %d", traceIDErr.SubCode)) + } + } + + spanID, spanIDErr = ccsmp.SolClientMessageGetCreationTraceContextSpanID(message.messagePointer) + if spanIDErr != nil { + ok = false + if spanIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Creation Context spanID property: "+spanIDErr.GetMessageAsString()+", sub code %d", spanIDErr.SubCode)) + } + } + + sampled, sampledErr = ccsmp.SolClientMessageGetCreationTraceContextSampled(message.messagePointer) + if sampledErr != nil { + ok = false + if sampledErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Creation Context sampled property: "+sampledErr.GetMessageAsString()+", sub code %d", sampledErr.SubCode)) + } + } + + traceState, traceStateErr = ccsmp.SolClientMessageGetCreationTraceContextTraceState(message.messagePointer) + if traceStateErr != nil { + // if we got an actual error + if traceStateErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + ok = false // set to false + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Creation Context traceState property: "+traceStateErr.GetMessageAsString()+", sub code %d", traceStateErr.SubCode)) + } + } + + // add the null terminate character to the returned traceState value + return traceID, spanID, sampled, traceState, ok +} + +// SetCreationTraceContext will set creation trace context metadata used for distributed message tracing. +// Creation context considered to be immutable, and should not be set multiple times. +// If the content could not be set into the message, the ok flag will be false. +func (message *MessageImpl) SetCreationTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) { + var traceIDErr, spanIDErr, sampledErr, traceStateErr core.ErrorInfo + ok = true // will remain true if we are able to set all the trace context properties + // set the creation trace context properties + traceIDErr = ccsmp.SolClientMessageSetCreationTraceContextTraceID(message.messagePointer, traceID) + if traceIDErr != nil { + ok = false + if traceIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Creation Context traceID property: "+traceIDErr.GetMessageAsString()+", sub code %d", traceIDErr.SubCode)) + } + } + + spanIDErr = ccsmp.SolClientMessageSetCreationTraceContextSpanID(message.messagePointer, spanID) + if spanIDErr != nil { + ok = false + if spanIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Creation Context spanID property: "+spanIDErr.GetMessageAsString()+", sub code %d", spanIDErr.SubCode)) + } + } + + sampledErr = ccsmp.SolClientMessageSetCreationTraceContextSampled(message.messagePointer, sampled) + if sampledErr != nil { + ok = false + if sampledErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Creation Context sampled property: "+sampledErr.GetMessageAsString()+", sub code %d", sampledErr.SubCode)) + } + } + + if traceState != nil { + traceStateErr = ccsmp.SolClientMessageSetCreationTraceContextTraceState(message.messagePointer, *traceState) + if traceStateErr != nil { + ok = false + if traceStateErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Creation Context traceState property: "+traceStateErr.GetMessageAsString()+", sub code %d", traceStateErr.SubCode)) + } + } + } + + return ok +} + +// GetTransportTraceContext will return the trace context metadata used for distributed message tracing +// It allows correlating the producer and the consumer with an intermediary. +// It also allows correlating multiple intermediaries among each other. +// When no transport context is present it may return a creation context when available as +// an initial transport context. +// If the content is not accessible, an empty slice will be returned and the ok flag will be false. +func (message *MessageImpl) GetTransportTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) { + var traceIDErr, spanIDErr, sampledErr, traceStateErr core.ErrorInfo + ok = true // will remain true if we are able to retrieve all the trace context properties + // get the transport trace context properties + traceID, traceIDErr = ccsmp.SolClientMessageGetTransportTraceContextTraceID(message.messagePointer) + if traceIDErr != nil { + ok = false + if traceIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Transport Context traceID property: "+traceIDErr.GetMessageAsString()+", sub code %d", traceIDErr.SubCode)) + } + } + + spanID, spanIDErr = ccsmp.SolClientMessageGetTransportTraceContextSpanID(message.messagePointer) + if spanIDErr != nil { + ok = false + if spanIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Transport Context spanID property: "+spanIDErr.GetMessageAsString()+", sub code %d", spanIDErr.SubCode)) + } + } + + sampled, sampledErr = ccsmp.SolClientMessageGetTransportTraceContextSampled(message.messagePointer) + if sampledErr != nil { + ok = false + if sampledErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Transport Context sampled property: "+sampledErr.GetMessageAsString()+", sub code %d", sampledErr.SubCode)) + } + } + + traceState, traceStateErr = ccsmp.SolClientMessageGetTransportTraceContextTraceState(message.messagePointer) + if traceStateErr != nil { + // if we got an actual error + if traceStateErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + ok = false // set to false + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Transport Context traceState property: "+traceStateErr.GetMessageAsString()+", sub code %d", traceStateErr.SubCode)) + } + } + + // add the null terminate character to the returned traceState value + return traceID, spanID, sampled, traceState, ok +} + +// SetTransportTraceContext will set transport trace context metadata used for distributed message tracing. +// If the content could not be set into the message, the ok flag will be false. +func (message *MessageImpl) SetTransportTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) { + var traceIDErr, spanIDErr, sampledErr, traceStateErr core.ErrorInfo + ok = true // will remain true if we are able to set all the trace context properties + // set the transport trace context properties + traceIDErr = ccsmp.SolClientMessageSetTransportTraceContextTraceID(message.messagePointer, traceID) + if traceIDErr != nil { + ok = false + if traceIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Transport Context traceID property: "+traceIDErr.GetMessageAsString()+", sub code %d", traceIDErr.SubCode)) + } + } + + spanIDErr = ccsmp.SolClientMessageSetTransportTraceContextSpanID(message.messagePointer, spanID) + if spanIDErr != nil { + ok = false + if spanIDErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Transport Context spanID property: "+spanIDErr.GetMessageAsString()+", sub code %d", spanIDErr.SubCode)) + } + } + + sampledErr = ccsmp.SolClientMessageSetTransportTraceContextSampled(message.messagePointer, sampled) + if sampledErr != nil { + ok = false + if sampledErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Transport Context sampled property: "+sampledErr.GetMessageAsString()+", sub code %d", sampledErr.SubCode)) + } + } + + if traceState != nil { + traceStateErr = ccsmp.SolClientMessageSetTransportTraceContextTraceState(message.messagePointer, string(*traceState)) + if traceStateErr != nil { + ok = false + if traceStateErr.ReturnCode == ccsmp.SolClientReturnCodeFail { + logging.Default.Warning(fmt.Sprintf("Failed to set Transport Context traceState property: "+traceStateErr.GetMessageAsString()+", sub code %d", traceStateErr.SubCode)) + } + } + } + + return ok +} + +// GetBaggage will return the baggage string associated with the message +// It is expected that string is UTF8 encoded. +// If the content is not accessible, an empty slice will +// be returned and the ok flag will be false. +func (message *MessageImpl) GetBaggage() (baggage string, ok bool) { + var err core.ErrorInfo + baggage, err = ccsmp.SolClientMessageGetBaggage(message.messagePointer) + ok = true // return true if value ir accessiable + if err != nil { + if err.ReturnCode == ccsmp.SolClientReturnCodeFail { + ok = false // return false, only when cannot access the data + logging.Default.Warning(fmt.Sprintf("Failed to retrieve Baggage: "+err.GetMessageAsString()+", sub code %d", err.SubCode)) + } + } + return baggage, ok +} + +// SetBaggage will set the baggage string associated with the message +// It is expected that string is UTF8 encoded. +func (message *MessageImpl) SetBaggage(baggage string) error { + err := ccsmp.SolClientMessageSetBaggage(message.messagePointer, baggage) + if err != nil { + logging.Default.Warning(fmt.Sprintf("Failed to set the Baggage: "+err.GetMessageAsString()+", sub code %d", err.SubCode)) + return core.ToNativeError(err, "error setting baggage: ") + } + return nil +} + func (message *MessageImpl) String() string { return ccsmp.SolClientMessageDump(message.messagePointer) } diff --git a/internal/impl/message/message_test.go b/internal/impl/message/message_test.go index 5785391..cd62cf8 100644 --- a/internal/impl/message/message_test.go +++ b/internal/impl/message/message_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ package message import ( + "encoding/hex" + "strings" "testing" "solace.dev/go/messaging/internal/ccsmp" @@ -62,3 +64,324 @@ func TestInboundMessageFree(t *testing.T) { t.Error("expected MessagePointer to be freed and set to nil, it was not") } } + +// Distributed Tracing + +func TestSetCreationTraceContext(t *testing.T) { + // the creation context value to test + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace=Example" + emptyTraceStateValue := "" + + var creationCtxTraceID16, emptyCreationCtxTraceID16 [16]byte + var creationCtxSpanID8, emptyCreationCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + + // test setting the creation context value + ok := msg.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, &traceStateValue) + if !ok { + t.Error("expected SetCreationTraceContext() function for valid values to succeed and return true") + } + + // test setting the creation context value - empty TraceID + okEmptyTraceID := msg.SetCreationTraceContext(emptyCreationCtxTraceID16, creationCtxSpanID8, sampledValue, &traceStateValue) + if !okEmptyTraceID { + t.Error("expected SetCreationTraceContext() function for empty TraceID to succeed and return true") + } + + // test setting the creation context value - empty SpanID + okEmptySpanID := msg.SetCreationTraceContext(creationCtxTraceID16, emptyCreationCtxSpanID8, sampledValue, &traceStateValue) + if !okEmptySpanID { + t.Error("expected SetCreationTraceContext() function for empty SpanID to succeed and return true") + } + + // test setting the creation context value - empty trace state + okEmptyTraceState := msg.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, &emptyTraceStateValue) + if !okEmptyTraceState { + t.Error("expected SetCreationTraceContext() function for empty traceState to succeed and return true") + } + + // test setting the creation context value - nil trace state + okNilTraceState := msg.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, nil) + if !okNilTraceState { + t.Error("expected SetCreationTraceContext() function for Nil traceState to succeed and return true") + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} + +func TestGetCreationTraceContext(t *testing.T) { + // the creation context value to test + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace=Example" + + var creationCtxTraceID16 [16]byte + var creationCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + + // test setting the creation context value + setValuesOk := msg.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, &traceStateValue) + if !setValuesOk { + t.Error("expected SetCreationTraceContext() function for valid values to succeed and return true") + } + + // get the creation context values + traceID, spanID, sampled, traceState, ok := msg.GetCreationTraceContext() + if !ok { + t.Error("expected GetCreationTraceContext() function to return creation context values and return true") + } + + // test traceID equality + if traceID != creationCtxTraceID16 { + t.Error("expected GetCreationTraceContext() traceID from message should be the same as what was set in message") + } + + // test spanID equality + if spanID != creationCtxSpanID8 { + t.Error("expected GetCreationTraceContext() spanID from message should be the same as what was set in message") + } + + // test traceID equality + if sampled != sampledValue { + t.Error("expected GetCreationTraceContext() sampled value from message should be the same as what was set in message") + } + + // test traceState equality + if strings.Compare(traceState, traceStateValue) != 0 { + t.Error("expected GetCreationTraceContext() traceState from message should be the same as what was set in message") + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} + +func TestSetTransportTraceContext(t *testing.T) { + // the transport context value to test + transportCtxTraceID, _ := hex.DecodeString("55d30916c9a3dad1eb4b328e00469e45") + transportCtxSpanID, _ := hex.DecodeString("a7164712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace=Example" + emptyTraceStateValue := "" + + var transportCtxTraceID16, emptyTransportCtxTraceID16 [16]byte + var transportCtxSpanID8, emptyTransportCtxSpanID8 [8]byte + copy(transportCtxTraceID16[:], transportCtxTraceID) + copy(transportCtxSpanID8[:], transportCtxSpanID) + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + + // test setting the transport context value + ok := msg.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, &traceStateValue) + if !ok { + t.Error("expected SetTransportTraceContext() function for valid values to succeed and return true") + } + + // test setting the transport context value - empty TraceID + okEmptyTraceID := msg.SetTransportTraceContext(emptyTransportCtxTraceID16, transportCtxSpanID8, sampledValue, &traceStateValue) + if !okEmptyTraceID { + t.Error("expected SetTransportTraceContext() function for empty TraceID to succeed and return true") + } + + // test setting the transport context value - empty SpanID + okEmptySpanID := msg.SetTransportTraceContext(transportCtxTraceID16, emptyTransportCtxSpanID8, sampledValue, &traceStateValue) + if !okEmptySpanID { + t.Error("expected SetTransportTraceContext() function for empty SpanID to succeed and return true") + } + + // test setting the transport context value - empty trace state + okEmptyTraceState := msg.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, &emptyTraceStateValue) + if !okEmptyTraceState { + t.Error("expected SetTransportTraceContext() function for empty traceState to succeed and return true") + } + + // test setting the transport context value - nil trace state + okNilTraceState := msg.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, nil) + if !okNilTraceState { + t.Error("expected SetTransportTraceContext() function for nil traceState to succeed and return true") + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} + +func TestGetTransportTraceContext(t *testing.T) { + // the transport context value to test + transportCtxTraceID, _ := hex.DecodeString("55d30916c9a3dad1eb4b328e00469e45") + transportCtxSpanID, _ := hex.DecodeString("a7164712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace=Example" + + var transportCtxTraceID16 [16]byte + var transportCtxSpanID8 [8]byte + copy(transportCtxTraceID16[:], transportCtxTraceID) + copy(transportCtxSpanID8[:], transportCtxSpanID) + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + + // test setting the transport context value + msg.SetCreationTraceContext(transportCtxTraceID16, transportCtxSpanID8, false, nil) // have to set creation context to prevent undesired behaviour + setValuesOk := msg.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, &traceStateValue) + if !setValuesOk { + t.Error("expected SetTransportTraceContext() function for valid values to succeed and return true") + } + + // get the transport context values + traceID, spanID, sampled, traceState, ok := msg.GetTransportTraceContext() + if !ok { + t.Error("expected GetTransportTraceContext() function to return transport context values and return true") + } + + // test traceID equality + if traceID != transportCtxTraceID16 { + t.Error("expected GetTransportTraceContext() traceID from message should be the same as what was set in message") + } + + // test spanID equality + if spanID != transportCtxSpanID8 { + t.Error("expected GetTransportTraceContext() spanID from message should be the same as what was set in message") + } + + // test traceID equality + if sampled != sampledValue { + t.Error("expected GetTransportTraceContext() sampled value from message should be the same as what was set in message") + } + + // test traceState equality + if strings.Compare(traceState, traceStateValue) != 0 { + t.Error("expected GetTransportTraceContext() traceState from message should be the same as what was set in message") + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} + +func TestSetBaggage(t *testing.T) { + // the baggage value to test + baggageValue := "baggage=value1;example=value2" + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + + // test setting a valid baggage value + err := msg.SetBaggage(baggageValue) + if err != nil { + t.Error(err) + } + + // test setting empty baggage + emptyCaseErr := msg.SetBaggage("") + if emptyCaseErr != nil { + t.Error(emptyCaseErr) + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} + +func TestGetBaggage(t *testing.T) { + // the baggage value to test + baggageValue := "baggage=value1;example=value2" + + msgP, ccsmpErr := ccsmp.SolClientMessageAlloc() + if ccsmpErr != nil { + t.Error("did not expect error, got " + ccsmpErr.GetMessageAsString()) + } + msg := NewInboundMessage(msgP, false) + if msg.messagePointer == nil { + t.Error("expected message pointer to not be nil") + } + if msg.IsDisposed() { + t.Error("message is disposed before disposed called") + } + // should not throw any errors + err := msg.SetBaggage(baggageValue) + if err != nil { + t.Error(err) + } + + baggage, ok := msg.GetBaggage() + if !ok { + t.Error("expected GetBaggage() function to return baggage and true") + } + if baggage == "" { + t.Error("expected baggage not to be an empty string") + } + if baggage != baggageValue { + t.Error("expected baggage from message should be the same baggage set on the message") + } + + msg.Dispose() + if !msg.IsDisposed() { + t.Error("IsDisposed returned false, expected true") + } +} diff --git a/internal/impl/message/outbound_message_builder_impl.go b/internal/impl/message/outbound_message_builder_impl.go index 648a140..1aef6c9 100644 --- a/internal/impl/message/outbound_message_builder_impl.go +++ b/internal/impl/message/outbound_message_builder_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/message/outbound_message_impl.go b/internal/impl/message/outbound_message_impl.go index 982bf85..5b700b6 100644 --- a/internal/impl/message/outbound_message_impl.go +++ b/internal/impl/message/outbound_message_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/message/rgmid_impl.go b/internal/impl/message/rgmid_impl.go index 27ee999..58bd13e 100644 --- a/internal/impl/message/rgmid_impl.go +++ b/internal/impl/message/rgmid_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/message/rgmid_impl_test.go b/internal/impl/message/rgmid_impl_test.go index 770f288..6e5ea56 100644 --- a/internal/impl/message/rgmid_impl_test.go +++ b/internal/impl/message/rgmid_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_builder_impl.go b/internal/impl/messaging_service_builder_impl.go index 637262b..5d22490 100644 --- a/internal/impl/messaging_service_builder_impl.go +++ b/internal/impl/messaging_service_builder_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_builder_impl_test.go b/internal/impl/messaging_service_builder_impl_test.go index d3d0278..ff6c0f5 100644 --- a/internal/impl/messaging_service_builder_impl_test.go +++ b/internal/impl/messaging_service_builder_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_impl.go b/internal/impl/messaging_service_impl.go index 3838239..e6423cb 100644 --- a/internal/impl/messaging_service_impl.go +++ b/internal/impl/messaging_service_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_impl_test.go b/internal/impl/messaging_service_impl_test.go index 638283f..1a0864f 100644 --- a/internal/impl/messaging_service_impl_test.go +++ b/internal/impl/messaging_service_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_metrics_impl.go b/internal/impl/messaging_service_metrics_impl.go index ddad654..f65eaa4 100644 --- a/internal/impl/messaging_service_metrics_impl.go +++ b/internal/impl/messaging_service_metrics_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_metrics_impl_test.go b/internal/impl/messaging_service_metrics_impl_test.go index 28b061d..8777e56 100644 --- a/internal/impl/messaging_service_metrics_impl_test.go +++ b/internal/impl/messaging_service_metrics_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/messaging_service_property_mapping.go b/internal/impl/messaging_service_property_mapping.go index 3946220..39fb72c 100644 --- a/internal/impl/messaging_service_property_mapping.go +++ b/internal/impl/messaging_service_property_mapping.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/buffer/publisher_task_buffer.go b/internal/impl/publisher/buffer/publisher_task_buffer.go index 43f27f7..a222827 100644 --- a/internal/impl/publisher/buffer/publisher_task_buffer.go +++ b/internal/impl/publisher/buffer/publisher_task_buffer.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/buffer/publisher_task_buffer_test.go b/internal/impl/publisher/buffer/publisher_task_buffer_test.go index a4acbbd..a9df5f2 100644 --- a/internal/impl/publisher/buffer/publisher_task_buffer_test.go +++ b/internal/impl/publisher/buffer/publisher_task_buffer_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/direct_message_publisher_impl.go b/internal/impl/publisher/direct_message_publisher_impl.go index 90675bd..0094129 100644 --- a/internal/impl/publisher/direct_message_publisher_impl.go +++ b/internal/impl/publisher/direct_message_publisher_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/direct_message_publisher_impl_test.go b/internal/impl/publisher/direct_message_publisher_impl_test.go index bbb6579..1c9af36 100644 --- a/internal/impl/publisher/direct_message_publisher_impl_test.go +++ b/internal/impl/publisher/direct_message_publisher_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/failed_publish_event.go b/internal/impl/publisher/failed_publish_event.go index 8abdda5..8e177c3 100644 --- a/internal/impl/publisher/failed_publish_event.go +++ b/internal/impl/publisher/failed_publish_event.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/message_publisher_impl.go b/internal/impl/publisher/message_publisher_impl.go index 169b376..4b7d65f 100644 --- a/internal/impl/publisher/message_publisher_impl.go +++ b/internal/impl/publisher/message_publisher_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/message_publisher_impl_test.go b/internal/impl/publisher/message_publisher_impl_test.go index 6843f77..01936ee 100644 --- a/internal/impl/publisher/message_publisher_impl_test.go +++ b/internal/impl/publisher/message_publisher_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/persistent_message_publisher_impl.go b/internal/impl/publisher/persistent_message_publisher_impl.go index 6422289..1d7ef5d 100644 --- a/internal/impl/publisher/persistent_message_publisher_impl.go +++ b/internal/impl/publisher/persistent_message_publisher_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/publisher/persistent_message_publisher_impl_test.go b/internal/impl/publisher/persistent_message_publisher_impl_test.go index bc6f72a..e31f57d 100644 --- a/internal/impl/publisher/persistent_message_publisher_impl_test.go +++ b/internal/impl/publisher/persistent_message_publisher_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/direct_message_receiver_impl.go b/internal/impl/receiver/direct_message_receiver_impl.go index 7b01550..6bf0c62 100644 --- a/internal/impl/receiver/direct_message_receiver_impl.go +++ b/internal/impl/receiver/direct_message_receiver_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/direct_message_receiver_impl_test.go b/internal/impl/receiver/direct_message_receiver_impl_test.go index 14926eb..438ae33 100644 --- a/internal/impl/receiver/direct_message_receiver_impl_test.go +++ b/internal/impl/receiver/direct_message_receiver_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/message_receiver_impl.go b/internal/impl/receiver/message_receiver_impl.go index d436392..98ae0ec 100644 --- a/internal/impl/receiver/message_receiver_impl.go +++ b/internal/impl/receiver/message_receiver_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/message_receiver_impl_test.go b/internal/impl/receiver/message_receiver_impl_test.go index c0e0384..43a3fb2 100644 --- a/internal/impl/receiver/message_receiver_impl_test.go +++ b/internal/impl/receiver/message_receiver_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/persistent_message_receiver_impl.go b/internal/impl/receiver/persistent_message_receiver_impl.go index 93cf6d6..b70a59c 100644 --- a/internal/impl/receiver/persistent_message_receiver_impl.go +++ b/internal/impl/receiver/persistent_message_receiver_impl.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/receiver/persistent_message_receiver_impl_test.go b/internal/impl/receiver/persistent_message_receiver_impl_test.go index 9c5dc46..1c30e8f 100644 --- a/internal/impl/receiver/persistent_message_receiver_impl_test.go +++ b/internal/impl/receiver/persistent_message_receiver_impl_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/rgmid.go b/internal/impl/rgmid.go index 416cc4e..f1a8b64 100644 --- a/internal/impl/rgmid.go +++ b/internal/impl/rgmid.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/validation/validator.go b/internal/impl/validation/validator.go index 17bc024..41d797c 100644 --- a/internal/impl/validation/validator.go +++ b/internal/impl/validation/validator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/impl/validation/validator_test.go b/internal/impl/validation/validator_test.go index 724145e..e309010 100644 --- a/internal/impl/validation/validator_test.go +++ b/internal/impl/validation/validator_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/messaging.go b/messaging.go index f71ce38..b385c84 100644 --- a/messaging.go +++ b/messaging.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/doc.go b/pkg/solace/config/doc.go index 97e5c59..4791b20 100644 --- a/pkg/solace/config/doc.go +++ b/pkg/solace/config/doc.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/format_utils.go b/pkg/solace/config/format_utils.go index 2a3524d..29a32a1 100644 --- a/pkg/solace/config/format_utils.go +++ b/pkg/solace/config/format_utils.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/format_utils_test.go b/pkg/solace/config/format_utils_test.go index 649ca7a..f673ba0 100644 --- a/pkg/solace/config/format_utils_test.go +++ b/pkg/solace/config/format_utils_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_properties.go b/pkg/solace/config/message_properties.go index 6282596..4fb73b4 100644 --- a/pkg/solace/config/message_properties.go +++ b/pkg/solace/config/message_properties.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_properties_test.go b/pkg/solace/config/message_properties_test.go index cd24ef8..ae40904 100644 --- a/pkg/solace/config/message_properties_test.go +++ b/pkg/solace/config/message_properties_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_publisher_constants.go b/pkg/solace/config/message_publisher_constants.go index 65e88b1..e39badc 100644 --- a/pkg/solace/config/message_publisher_constants.go +++ b/pkg/solace/config/message_publisher_constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_publisher_properties.go b/pkg/solace/config/message_publisher_properties.go index 3c30f32..0b32827 100644 --- a/pkg/solace/config/message_publisher_properties.go +++ b/pkg/solace/config/message_publisher_properties.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_publisher_properties_test.go b/pkg/solace/config/message_publisher_properties_test.go index ebb8d82..a53e005 100644 --- a/pkg/solace/config/message_publisher_properties_test.go +++ b/pkg/solace/config/message_publisher_properties_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_receiver_constants.go b/pkg/solace/config/message_receiver_constants.go index 4b1aba0..c9cc8cc 100644 --- a/pkg/solace/config/message_receiver_constants.go +++ b/pkg/solace/config/message_receiver_constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_receiver_properties.go b/pkg/solace/config/message_receiver_properties.go index 4a1111f..0f0ae49 100644 --- a/pkg/solace/config/message_receiver_properties.go +++ b/pkg/solace/config/message_receiver_properties.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_receiver_properties_test.go b/pkg/solace/config/message_receiver_properties_test.go index 79cbfeb..d430a9e 100644 --- a/pkg/solace/config/message_receiver_properties_test.go +++ b/pkg/solace/config/message_receiver_properties_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_receiver_strategies.go b/pkg/solace/config/message_receiver_strategies.go index d0dfb41..ca2e9aa 100644 --- a/pkg/solace/config/message_receiver_strategies.go +++ b/pkg/solace/config/message_receiver_strategies.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/message_user_property_constants.go b/pkg/solace/config/message_user_property_constants.go index bed7ec8..f93c476 100644 --- a/pkg/solace/config/message_user_property_constants.go +++ b/pkg/solace/config/message_user_property_constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/messaging_service_constants.go b/pkg/solace/config/messaging_service_constants.go index b70db08..658b207 100644 --- a/pkg/solace/config/messaging_service_constants.go +++ b/pkg/solace/config/messaging_service_constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/messaging_service_properties.go b/pkg/solace/config/messaging_service_properties.go index e7eb50a..dc166ca 100644 --- a/pkg/solace/config/messaging_service_properties.go +++ b/pkg/solace/config/messaging_service_properties.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -297,8 +297,7 @@ const ( TransportLayerSecurityPropertyCipherSuites ServiceProperty = "solace.messaging.tls.cipher-suites" // TransportLayerSecurityPropertyTrustStorePath specifies the path of the directory where trusted certificates are found - // A maximum of 64 files are allowed in the trust store directory. The maximum depth for the - // certificate chain verification is 3. + // The maximum depth for the certificate chain verification is 3. TransportLayerSecurityPropertyTrustStorePath ServiceProperty = "solace.messaging.tls.trust-store-path" // TransportLayerSecurityPropertyTrustedCommonNameList is provided for legacy installations and is not recommended as part of our best practices. diff --git a/pkg/solace/config/messaging_service_properties_test.go b/pkg/solace/config/messaging_service_properties_test.go index 3f135f7..1536a18 100644 --- a/pkg/solace/config/messaging_service_properties_test.go +++ b/pkg/solace/config/messaging_service_properties_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/config/messaging_service_strategies.go b/pkg/solace/config/messaging_service_strategies.go index 6f3bb2e..27fcce4 100644 --- a/pkg/solace/config/messaging_service_strategies.go +++ b/pkg/solace/config/messaging_service_strategies.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/direct_message_publisher.go b/pkg/solace/direct_message_publisher.go index 2ce34ce..0d5e64a 100644 --- a/pkg/solace/direct_message_publisher.go +++ b/pkg/solace/direct_message_publisher.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/direct_message_receiver.go b/pkg/solace/direct_message_receiver.go index 13258ed..ea092cb 100644 --- a/pkg/solace/direct_message_receiver.go +++ b/pkg/solace/direct_message_receiver.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/doc.go b/pkg/solace/doc.go index df37c3b..c2de92f 100644 --- a/pkg/solace/doc.go +++ b/pkg/solace/doc.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/errors.go b/pkg/solace/errors.go index 5a9bf7b..d34374c 100644 --- a/pkg/solace/errors.go +++ b/pkg/solace/errors.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/lifecycle.go b/pkg/solace/lifecycle.go index 424cbdd..cd77cff 100644 --- a/pkg/solace/lifecycle.go +++ b/pkg/solace/lifecycle.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/logging/logging.go b/pkg/solace/logging/logging.go index 5547bea..deef99d 100644 --- a/pkg/solace/logging/logging.go +++ b/pkg/solace/logging/logging.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/disposable.go b/pkg/solace/message/disposable.go index 13b3ae8..0140f12 100644 --- a/pkg/solace/message/disposable.go +++ b/pkg/solace/message/disposable.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/doc.go b/pkg/solace/message/doc.go index 4422987..ffc35f5 100644 --- a/pkg/solace/message/doc.go +++ b/pkg/solace/message/doc.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/inbound_message.go b/pkg/solace/message/inbound_message.go index 02334cd..8702ec1 100644 --- a/pkg/solace/message/inbound_message.go +++ b/pkg/solace/message/inbound_message.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/message.go b/pkg/solace/message/message.go index 6f1a82f..84b03c0 100644 --- a/pkg/solace/message/message.go +++ b/pkg/solace/message/message.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/outbound_message.go b/pkg/solace/message/outbound_message.go index 6aa77af..bd59902 100644 --- a/pkg/solace/message/outbound_message.go +++ b/pkg/solace/message/outbound_message.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/rgmid/replication_group_message_id.go b/pkg/solace/message/rgmid/replication_group_message_id.go index 7d9953c..5e535c6 100644 --- a/pkg/solace/message/rgmid/replication_group_message_id.go +++ b/pkg/solace/message/rgmid/replication_group_message_id.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/sdt/structured_data_types.go b/pkg/solace/message/sdt/structured_data_types.go index f3872d3..c85f82f 100644 --- a/pkg/solace/message/sdt/structured_data_types.go +++ b/pkg/solace/message/sdt/structured_data_types.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message/sdt/structured_data_types_test.go b/pkg/solace/message/sdt/structured_data_types_test.go index a3431d8..7ad7454 100644 --- a/pkg/solace/message/sdt/structured_data_types_test.go +++ b/pkg/solace/message/sdt/structured_data_types_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message_publisher.go b/pkg/solace/message_publisher.go index 54356bf..8a86406 100644 --- a/pkg/solace/message_publisher.go +++ b/pkg/solace/message_publisher.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/message_receiver.go b/pkg/solace/message_receiver.go index 83960d3..41b19e1 100644 --- a/pkg/solace/message_receiver.go +++ b/pkg/solace/message_receiver.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/messaging_service.go b/pkg/solace/messaging_service.go index 3b4627a..72f6cf9 100644 --- a/pkg/solace/messaging_service.go +++ b/pkg/solace/messaging_service.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/metrics/metrics.go b/pkg/solace/metrics/metrics.go index 02afb85..1b72b4e 100644 --- a/pkg/solace/metrics/metrics.go +++ b/pkg/solace/metrics/metrics.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/outbound_message_builder.go b/pkg/solace/outbound_message_builder.go index 946651c..aa6b1c8 100644 --- a/pkg/solace/outbound_message_builder.go +++ b/pkg/solace/outbound_message_builder.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/persistent_message_publisher.go b/pkg/solace/persistent_message_publisher.go index 0cc0af8..3d04f80 100644 --- a/pkg/solace/persistent_message_publisher.go +++ b/pkg/solace/persistent_message_publisher.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/persistent_message_receiver.go b/pkg/solace/persistent_message_receiver.go index e7e355e..2ad5e25 100644 --- a/pkg/solace/persistent_message_receiver.go +++ b/pkg/solace/persistent_message_receiver.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/resource/destination.go b/pkg/solace/resource/destination.go index a311f9a..4fd3f56 100644 --- a/pkg/solace/resource/destination.go +++ b/pkg/solace/resource/destination.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/resource/destination_test.go b/pkg/solace/resource/destination_test.go index 5ec8ebe..e0cdb71 100644 --- a/pkg/solace/resource/destination_test.go +++ b/pkg/solace/resource/destination_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/subcode/subcode.go b/pkg/solace/subcode/subcode.go index a1bc946..23b226a 100644 --- a/pkg/solace/subcode/subcode.go +++ b/pkg/solace/subcode/subcode.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/solace/subcode/subcode_generated.go b/pkg/solace/subcode/subcode_generated.go index 54c26bf..023b21c 100644 --- a/pkg/solace/subcode/subcode_generated.go +++ b/pkg/solace/subcode/subcode_generated.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -344,4 +344,8 @@ const ( SyncReplicationIneligible Code = 161 // EndpointShutdown: The client has attempted to publish to a topic that matched a queue or topic endpoint subscription which has its ingress flow shutdown. EndpointShutdown Code = 162 + // AdAppAckFailedNotSupported: Fail and Reject message settlement outcomes not supported on the Solace Message Router. + AdAppAckFailedNotSupported Code = 163 + // InvalidDurability: The client has attempted to bind a flow to a durable queue or topic endpoint with SOLCLIENT_FLOW_PROP_BIND_ENTITY_DURABLE disabled. + InvalidDurability Code = 164 ) diff --git a/pkg/solace/subcode/subcode_generator.go b/pkg/solace/subcode/subcode_generator.go index ec3e7ed..e1fd48d 100644 --- a/pkg/solace/subcode/subcode_generator.go +++ b/pkg/solace/subcode/subcode_generator.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/config_test.go b/test/config_test.go index 97d6cfb..52b561a 100644 --- a/test/config_test.go +++ b/test/config_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/constants/test_constants.go b/test/constants/test_constants.go index bec10c9..fc02d95 100644 --- a/test/constants/test_constants.go +++ b/test/constants/test_constants.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/direct_publisher_test.go b/test/direct_publisher_test.go index 3cefc69..b1f5096 100644 --- a/test/direct_publisher_test.go +++ b/test/direct_publisher_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/direct_receiver_test.go b/test/direct_receiver_test.go index ee1c1f2..33199c2 100644 --- a/test/direct_receiver_test.go +++ b/test/direct_receiver_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/helpers/builder_helpers.go b/test/helpers/builder_helpers.go index 15ec5e8..b71e3d7 100644 --- a/test/helpers/builder_helpers.go +++ b/test/helpers/builder_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/helpers/error_helpers.go b/test/helpers/error_helpers.go index 7df5bfd..20a451c 100644 --- a/test/helpers/error_helpers.go +++ b/test/helpers/error_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/helpers/lifecycle_helpers.go b/test/helpers/lifecycle_helpers.go index 0a62d0e..d8f0354 100644 --- a/test/helpers/lifecycle_helpers.go +++ b/test/helpers/lifecycle_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/helpers/messaging_service_helpers.go b/test/helpers/messaging_service_helpers.go index adce1dc..c1f3959 100644 --- a/test/helpers/messaging_service_helpers.go +++ b/test/helpers/messaging_service_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/helpers/resource_helpers.go b/test/helpers/resource_helpers.go index eaf2d95..c287525 100644 --- a/test/helpers/resource_helpers.go +++ b/test/helpers/resource_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -64,17 +64,17 @@ func CreateNonExclusiveQueue(queueName string, topics ...string) { // CreatePartitionedQueue function func CreatePartitionedQueue(queueName string, partitionCount int32, partitionRebalanceDelay int64, topics ...string) { - _, _, err := testcontext.SEMP().Config().QueueApi.CreateMsgVpnQueue(testcontext.SEMP() .ConfigCtx(), sempconfig.MsgVpnQueue{ - QueueName: queueName, - AccessType: "non-exclusive", - Permission: "modify-topic", - IngressEnabled: True, - EgressEnabled: True, - PartitionCount: partitionCount, - PartitionRebalanceDelay: partitionRebalanceDelay, - Owner: "default", - }, testcontext.Messaging().VPN, nil) - ExpectWithOffset(1, err).ToNot(HaveOccurred(), "Failed to create queue with name "+queueName) + _, _, err := testcontext.SEMP().Config().QueueApi.CreateMsgVpnQueue(testcontext.SEMP().ConfigCtx(), sempconfig.MsgVpnQueue{ + QueueName: queueName, + AccessType: "non-exclusive", + Permission: "modify-topic", + IngressEnabled: True, + EgressEnabled: True, + PartitionCount: partitionCount, + PartitionRebalanceDelay: partitionRebalanceDelay, + Owner: "default", + }, testcontext.Messaging().VPN, nil) + ExpectWithOffset(1, err).ToNot(HaveOccurred(), "Failed to create queue with name "+queueName) for _, topic := range topics { _, _, err = testcontext.SEMP().Config().QueueApi.CreateMsgVpnQueueSubscription(testcontext.SEMP().ConfigCtx(), sempconfig.MsgVpnQueueSubscription{ diff --git a/test/helpers/semp_helpers.go b/test/helpers/semp_helpers.go index f8b272b..29af0a5 100644 --- a/test/helpers/semp_helpers.go +++ b/test/helpers/semp_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,9 +17,10 @@ package helpers import ( + "time" + "solace.dev/go/messaging/test/sempclient/config" "solace.dev/go/messaging/test/testcontext" - "time" ) // Our generated SEMPv2 client has **bool as the datatype for booleans to be able to differentiate between "missing" and "false" diff --git a/test/helpers/toxic_helpers.go b/test/helpers/toxic_helpers.go index ef252ee..78b00f8 100644 --- a/test/helpers/toxic_helpers.go +++ b/test/helpers/toxic_helpers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/kerberos_test.go b/test/kerberos_test.go index cc3d043..e7ef3b8 100644 --- a/test/kerberos_test.go +++ b/test/kerberos_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/main_test.go b/test/main_test.go index 5781004..8056fb9 100644 --- a/test/main_test.go +++ b/test/main_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/message_test.go b/test/message_test.go index f0cadf3..df55783 100644 --- a/test/message_test.go +++ b/test/message_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package test import ( + "encoding/hex" "fmt" "reflect" "time" @@ -80,6 +81,54 @@ var fromConfigProviderInvalidTestCases = map[config.MessageProperty]interface{}{ config.MessagePropertySenderID: dummyStruct{}, } +// InboundMessageWithTracingSupport represents a message received by a consumer. +type InboundMessageWithTracingSupport interface { + // Extend the InboundMessage interface. + message.InboundMessage + + // GetCreationTraceContext will return the trace context metadata used for distributed message tracing message + GetCreationTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) + + // SetTraceContext will set creation trace context metadata used for distributed message tracing. + SetCreationTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) + + // GetTransportTraceContext will return the trace context metadata used for distributed message tracing + GetTransportTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) + + // SetTraceContext will set transport trace context metadata used for distributed message tracing. + SetTransportTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) + + // GetBaggage will return the baggage string associated with the message + GetBaggage() (baggage string, ok bool) + + // SetBaggage will set the baggage string associated with the message + SetBaggage(baggage string) error +} + +// OutboundMessageWithTracingSupport represents a message received by a consumer. +type OutboundMessageWithTracingSupport interface { + // Extend the OutboundMessage interface. + message.OutboundMessage + + // GetCreationTraceContext will return the trace context metadata used for distributed message tracing message + GetCreationTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) + + // SetTraceContext will set creation trace context metadata used for distributed message tracing. + SetCreationTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) + + // GetTransportTraceContext will return the trace context metadata used for distributed message tracing + GetTransportTraceContext() (traceID [16]byte, spanID [8]byte, sampled bool, traceState string, ok bool) + + // SetTraceContext will set transport trace context metadata used for distributed message tracing. + SetTransportTraceContext(traceID [16]byte, spanID [8]byte, sampled bool, traceState *string) (ok bool) + + // GetBaggage will return the baggage string associated with the message + GetBaggage() (baggage string, ok bool) + + // SetBaggage will set the baggage string associated with the message + SetBaggage(baggage string) error +} + var _ = Describe("Local MessageBuilder Tests", func() { var messageBuilder solace.OutboundMessageBuilder @@ -1935,4 +1984,371 @@ var _ = Describe("Remote Message Tests", func() { }) }) + Describe("Published and received message with Distributed Tracing support", func() { + var publisher solace.DirectMessagePublisher + var receiver solace.DirectMessageReceiver + var inboundMessageChannel chan InboundMessageWithTracingSupport + + BeforeEach(func() { + var err error + err = messagingService.Connect() + Expect(err).ToNot(HaveOccurred()) + + publisher, err = messagingService.CreateDirectMessagePublisherBuilder().Build() + Expect(err).ToNot(HaveOccurred()) + receiver, err = messagingService.CreateDirectMessageReceiverBuilder().WithSubscriptions(resource.TopicSubscriptionOf(topic)).Build() + Expect(err).ToNot(HaveOccurred()) + + err = publisher.Start() + Expect(err).ToNot(HaveOccurred()) + + inboundMessageChannel = make(chan InboundMessageWithTracingSupport) + receiver.ReceiveAsync(func(inboundMessage message.InboundMessage) { + inboundMessageChannel <- inboundMessage.(InboundMessageWithTracingSupport) + }) + + err = receiver.Start() + Expect(err).ToNot(HaveOccurred()) + }) + + AfterEach(func() { + var err error + err = publisher.Terminate(10 * time.Second) + Expect(err).ToNot(HaveOccurred()) + err = receiver.Terminate(10 * time.Second) + Expect(err).ToNot(HaveOccurred()) + + err = messagingService.Disconnect() + Expect(err).ToNot(HaveOccurred()) + }) + + It("should be able to publish/receive a message with no creation context", func() { + message, err := messageBuilder.Build() // no creation context is set on message + Expect(err).ToNot(HaveOccurred()) + + publisher.Publish(message, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetCreationTraceContext() + Expect(ok).To(BeFalse()) + Expect(traceID).To(Equal([16]byte{})) // empty + Expect(spanID).To(Equal([8]byte{})) // empty + Expect(sampled).To(BeFalse()) + Expect(traceState).To(Equal("")) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid creation context", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set creation context on message + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace1=Example1" + + var creationCtxTraceID16 [16]byte + var creationCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + ok := messageWithDT.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, &traceStateValue) + Expect(ok).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetCreationTraceContext() + Expect(ok).To(BeTrue()) + Expect(traceID).To(Equal(creationCtxTraceID16)) // should be equal + Expect(spanID).To(Equal(creationCtxSpanID8)) // should be equal + Expect(sampled).To(Equal(sampledValue)) + Expect(traceState).To(Equal(traceStateValue)) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid creation context without trace state", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set creation context on message + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + sampledValue := true + + var creationCtxTraceID16 [16]byte + var creationCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + ok := messageWithDT.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, nil) // no trace state + Expect(ok).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetCreationTraceContext() + Expect(ok).To(BeTrue()) + Expect(traceID).To(Equal(creationCtxTraceID16)) // should be equal + Expect(spanID).To(Equal(creationCtxSpanID8)) // should be equal + Expect(sampled).To(Equal(sampledValue)) + Expect(traceState).To(Equal("")) // should be empty + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with no tranport context", func() { + message, err := messageBuilder.Build() // no creation context is set on message + Expect(err).ToNot(HaveOccurred()) + + publisher.Publish(message, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetTransportTraceContext() + Expect(ok).To(BeFalse()) + Expect(traceID).To(Equal([16]byte{})) // empty + Expect(spanID).To(Equal([8]byte{})) // empty + Expect(sampled).To(BeFalse()) + Expect(traceState).To(Equal("")) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid transport context", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set transport context on message + transportCtxTraceID, _ := hex.DecodeString("55d30916c9a3dad1eb4b328e00469e45") + transportCtxSpanID, _ := hex.DecodeString("a7164712c4e1f17f") + + sampledValue := true + traceStateValue := "trace=Sample" + + var transportCtxTraceID16 [16]byte + var transportCtxSpanID8 [8]byte + copy(transportCtxTraceID16[:], transportCtxTraceID) + copy(transportCtxSpanID8[:], transportCtxSpanID) + ok := messageWithDT.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, &traceStateValue) + Expect(ok).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetTransportTraceContext() + Expect(ok).To(BeTrue()) + Expect(traceID).To(Equal(transportCtxTraceID16)) // should be equal + Expect(spanID).To(Equal(transportCtxSpanID8)) // should be equal + Expect(sampled).To(BeTrue()) + Expect(traceState).To(Equal(traceStateValue)) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid transport context without trace state", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set transport context on message + transportCtxTraceID, _ := hex.DecodeString("55d30916c9a3dad1eb4b328e00469e45") + transportCtxSpanID, _ := hex.DecodeString("a7164712c4e1f17f") + sampledValue := true + + var transportCtxTraceID16 [16]byte + var transportCtxSpanID8 [8]byte + copy(transportCtxTraceID16[:], transportCtxTraceID) + copy(transportCtxSpanID8[:], transportCtxSpanID) + ok := messageWithDT.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, sampledValue, nil) + Expect(ok).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + traceID, spanID, sampled, traceState, ok := message.GetTransportTraceContext() + Expect(ok).To(BeTrue()) + Expect(traceID).To(Equal(transportCtxTraceID16)) // should be equal + Expect(spanID).To(Equal(transportCtxSpanID8)) // should be equal + Expect(sampled).To(BeTrue()) + Expect(traceState).To(Equal("")) // should be empty + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid creation context and no transport context", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set creation context on message + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + sampledValue := true + traceStateValue := "sometrace=Example" + + var creationCtxTraceID16 [16]byte + var creationCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + ok := messageWithDT.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, sampledValue, &traceStateValue) + Expect(ok).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + creationTraceID, creationSpanID, creationSampled, creationTraceState, creationOk := message.GetCreationTraceContext() + transportTraceID, transportSpanID, transportSampled, transportTraceState, transportOk := message.GetTransportTraceContext() + + Expect(creationOk).To(BeTrue()) + Expect(creationTraceID).To(Equal(creationCtxTraceID16)) // should be equal + Expect(creationSpanID).To(Equal(creationCtxSpanID8)) // should be equal + Expect(creationSampled).To(BeTrue()) + Expect(creationTraceState).To(Equal(traceStateValue)) + + Expect(transportOk).To(BeFalse()) + Expect(transportTraceID).To(Equal([16]byte{})) // empty + Expect(transportSpanID).To(Equal([8]byte{})) // empty + Expect(transportSampled).To(BeFalse()) + Expect(transportTraceState).To(Equal("")) + + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with different creation context and transport context", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + // set creation context on message + creationCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + creationCtxSpanID, _ := hex.DecodeString("3b364712c4e1f17f") + creationCtxTraceState := "sometrace1=Example1" + + // set transport context on message + transportCtxTraceID, _ := hex.DecodeString("79f90916c9a3dad1eb4b328e00469e45") + transportCtxSpanID, _ := hex.DecodeString("a7164712c4e1f17f") + transportCtxTraceState := "sometrace2=Example2" + + var creationCtxTraceID16, transportCtxTraceID16 [16]byte + var creationCtxSpanID8, transportCtxSpanID8 [8]byte + copy(creationCtxTraceID16[:], creationCtxTraceID) + copy(creationCtxSpanID8[:], creationCtxSpanID) + setCreationCtxOk := messageWithDT.SetCreationTraceContext(creationCtxTraceID16, creationCtxSpanID8, true, &creationCtxTraceState) + Expect(setCreationCtxOk).To(BeTrue()) + + copy(transportCtxTraceID16[:], transportCtxTraceID) + copy(transportCtxSpanID8[:], transportCtxSpanID) + setTransportCtxOk := messageWithDT.SetTransportTraceContext(transportCtxTraceID16, transportCtxSpanID8, true, &transportCtxTraceState) + Expect(setTransportCtxOk).To(BeTrue()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + creationTraceID, creationSpanID, creationSampled, creationTraceState, creationOk := message.GetCreationTraceContext() + transportTraceID, transportSpanID, transportSampled, transportTraceState, transportOk := message.GetTransportTraceContext() + + Expect(creationOk).To(BeTrue()) + Expect(creationTraceID).To(Equal(creationCtxTraceID16)) // should be equal + Expect(creationSpanID).To(Equal(creationCtxSpanID8)) // should be equal + Expect(creationSampled).To(BeTrue()) + Expect(creationTraceState).To(Equal(creationCtxTraceState)) + + Expect(transportOk).To(BeTrue()) + Expect(transportTraceID).ToNot(Equal([16]byte{})) // not empty + Expect(transportTraceID).To(Equal(transportCtxTraceID16)) // should be equal + + Expect(transportSpanID).ToNot(Equal([8]byte{})) // not empty + Expect(transportSpanID).To(Equal(transportCtxSpanID8)) // should be equal + + Expect(transportSampled).To(BeTrue()) + Expect(transportTraceState).To(Equal(transportCtxTraceState)) + + Expect(creationTraceID).To(Equal(transportTraceID)) // should be equal + Expect(creationSpanID).ToNot(Equal(transportSpanID)) // should not be equal + Expect(creationTraceState).ToNot(Equal(transportTraceState)) // should not be equal + + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with no baggage", func() { + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + baggageErr := messageWithDT.SetBaggage("") // set empty baggage + Expect(baggageErr).To(BeNil()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + baggage, ok := message.GetBaggage() + Expect(ok).To(BeTrue()) + Expect(baggage).To(Equal("")) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + It("should be able to publish/receive a message with a valid baggage", func() { + baggage := "baggage1=payload1" + message, err := messageBuilder.Build() + Expect(err).ToNot(HaveOccurred()) + + // cast the message to the extended interface that has message tracing support + messageWithDT := message.(OutboundMessageWithTracingSupport) + + baggageErr := messageWithDT.SetBaggage(baggage) // set a valid baggage string + Expect(baggageErr).To(BeNil()) + + publisher.Publish(messageWithDT, resource.TopicOf(topic)) + + select { + case message := <-inboundMessageChannel: + receivedBaggage, ok := message.GetBaggage() + Expect(ok).To(BeTrue()) + Expect(receivedBaggage).To(Equal(baggage)) + case <-time.After(1 * time.Second): + Fail("timed out waiting for message to be delivered") + } + }) + + }) + }) diff --git a/test/messaging_service_test.go b/test/messaging_service_test.go index b17112f..edee2ee 100644 --- a/test/messaging_service_test.go +++ b/test/messaging_service_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/metrics_test.go b/test/metrics_test.go index 5c6da78..9151060 100644 --- a/test/metrics_test.go +++ b/test/metrics_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/missing_resource_test.go b/test/missing_resource_test.go index b2269b9..d8973cb 100644 --- a/test/missing_resource_test.go +++ b/test/missing_resource_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ package test import ( + "time" + "solace.dev/go/messaging" "solace.dev/go/messaging/pkg/solace" "solace.dev/go/messaging/pkg/solace/config" @@ -24,7 +26,6 @@ import ( "solace.dev/go/messaging/pkg/solace/subcode" "solace.dev/go/messaging/test/helpers" "solace.dev/go/messaging/test/testcontext" - "time" sempconfig "solace.dev/go/messaging/test/sempclient/config" diff --git a/test/oauth_test.go b/test/oauth_test.go index 6668639..289e134 100644 --- a/test/oauth_test.go +++ b/test/oauth_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/partitioned_queue_test.go b/test/partitioned_queue_test.go index 9009560..6fab15e 100644 --- a/test/partitioned_queue_test.go +++ b/test/partitioned_queue_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2022 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,306 +17,318 @@ package test import ( - "time" - "fmt" - "strconv" - - "solace.dev/go/messaging" - "solace.dev/go/messaging/pkg/solace" - "solace.dev/go/messaging/pkg/solace/config" - "solace.dev/go/messaging/pkg/solace/metrics" - "solace.dev/go/messaging/pkg/solace/resource" - //"solace.dev/go/messaging/pkg/solace/subcode" - "solace.dev/go/messaging/test/helpers" - "solace.dev/go/messaging/test/testcontext" - "solace.dev/go/messaging/pkg/solace/message" - - sempconfig "solace.dev/go/messaging/test/sempclient/config" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + "fmt" + "strconv" + "time" + + "solace.dev/go/messaging" + "solace.dev/go/messaging/pkg/solace" + "solace.dev/go/messaging/pkg/solace/config" + "solace.dev/go/messaging/pkg/solace/metrics" + "solace.dev/go/messaging/pkg/solace/resource" + + //"solace.dev/go/messaging/pkg/solace/subcode" + "solace.dev/go/messaging/pkg/solace/message" + "solace.dev/go/messaging/test/helpers" + "solace.dev/go/messaging/test/testcontext" + + sempconfig "solace.dev/go/messaging/test/sempclient/config" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) +const PQLabel string = "partition_queue" + var _ = Describe("Partitioned Queue Tests", func() { - var queueName string = "partitioned_queue_test" - var topicName string = "partitioned_queue_topic_test" - var rebalanceDelay int64 = 5 - var partitionCount int32 = 3 - Context("queue has three partitions and rebalance delay of 1 second", func() { - BeforeEach(func() { - helpers.CreatePartitionedQueue(queueName, partitionCount, rebalanceDelay, topicName) - }) - - AfterEach(func() { - helpers.DeleteQueue(queueName) - }) - - It("should have at least one key assigned to each partition and same keyed messages go to same partition", func() { - var messagingServices[4]solace.MessagingService - var partitionKeys[9]string - - //generate partition keys - for i := 0; i < 9; i++{ - partitionKeys[i] = "key_"+ strconv.Itoa(i) - } - - for i := 0; i < 4; i++{ - messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder().FromConfigurationProvider(helpers.DefaultConfiguration())) - helpers.ConnectMessagingService(messagingServices[i]) - } - - defer func() { - for i := 0; i < 4; i++{ - helpers.DisconnectMessagingService(messagingServices[i]) - } - }() - - - partitionedQueue := resource.QueueDurableNonExclusive(queueName) - publisher := helpers.NewPersistentPublisher(messagingServices[0]) - - - receiverOne, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) - - receiverTwo, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) - - receiverThree, _ := messagingServices[3].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) - - publisher.Start() - receiverOne.Start() - receiverTwo.Start() - receiverThree.Start() - - messageBuilder := messagingServices[0].MessageBuilder() - for i := 0; i < 18; i++{ - msg, _ := messageBuilder.WithProperty(config.MessageProperty(config.QueuePartitionKey), partitionKeys[i % 9]).BuildWithStringPayload("Hi Solace") - publisher.Publish(msg, resource.TopicOf(topicName), nil, nil) - } - - publisher.Terminate(5 * time.Second) - - messageHandler := func(message message.InboundMessage) { - fmt.Println("message received") - } - - receiverOne.ReceiveAsync(messageHandler) - receiverTwo.ReceiveAsync(messageHandler) - receiverThree.ReceiveAsync(messageHandler) - - publisherMetrics := messagingServices[0].Metrics() - receiverOneMetrics := messagingServices[1].Metrics() - receiverTwoMetrics := messagingServices[2].Metrics() - receiverThreeMetrics := messagingServices[3].Metrics() - - Eventually(func() uint64 { - return receiverOneMetrics.GetValue(metrics.PersistentMessagesReceived) - }).WithTimeout(10 * time.Second).Should(BeNumerically(">=", 2)) - - Eventually(func() uint64 { - return receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) - }).WithTimeout(10 * time.Second).Should(BeNumerically(">=", 2)) - - Eventually(func() uint64 { - return receiverThreeMetrics.GetValue(metrics.PersistentMessagesReceived) - }).WithTimeout(10 * time.Second).Should(BeNumerically(">=", 2)) - - Eventually( func() uint64 { - totalMessagesReceived := receiverOneMetrics. - GetValue(metrics.PersistentMessagesReceived) + receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) + receiverThreeMetrics.GetValue(metrics.PersistentMessagesReceived) - return totalMessagesReceived - }).WithTimeout(10 * time.Second).Should(Equal(publisherMetrics.GetValue(metrics.TotalMessagesSent))) - - Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - Expect(receiverThree.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - }) - - It("generates flow inactive event when no partitions left for consumer to bind", func() { - - var listenerOne solace.ReceiverStateChangeListener - var listenerTwo solace.ReceiverStateChangeListener - var listenerThree solace.ReceiverStateChangeListener - - var messagingServices[3]solace.MessagingService - - partitionedQueue := resource.QueueDurableNonExclusive(queueName) - - for i := 0; i < 3; i++{ - messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder(). - FromConfigurationProvider(helpers.DefaultConfiguration())) - helpers.ConnectMessagingService(messagingServices[i]) - } - - defer func() { - for i := 0; i < 3; i++{ - helpers.DisconnectMessagingService(messagingServices[i]) - } - }() - //activeStateTransitions refer to start-up induced state changes - //(i.e., receiver transition from passive to active whereas passive transitions are induced on partition downscale - activeStateTransitions, passiveStateTransitions := 0, 0 - ch := make(chan struct{}) - - passiveTransitionIncrementor := func(oldState, newState solace.ReceiverState, timestamp time.Time) { - if oldState == solace.ReceiverActive && newState == solace.ReceiverPassive { - passiveStateTransitions++ - } else { - activeStateTransitions++ - } - - if passiveStateTransitions == 2 && activeStateTransitions == 3 { - close(ch) - } - } - - listenerOne, listenerTwo, listenerThree = passiveTransitionIncrementor, passiveTransitionIncrementor, passiveTransitionIncrementor - - receiverOne, _ := messagingServices[0].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerOne).Build(partitionedQueue) - - receiverTwo, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerTwo).Build(partitionedQueue) - - receiverThree, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerThree).Build(partitionedQueue) - - Expect(receiverOne.Start()).ToNot(HaveOccurred()) - Expect(receiverTwo.Start()).ToNot(HaveOccurred()) - Expect(receiverThree.Start()).ToNot(HaveOccurred()) - - time.Sleep(10 * time.Second) - - testcontext.SEMP().Config().QueueApi.UpdateMsgVpnQueue( - testcontext.SEMP().ConfigCtx(), - sempconfig.MsgVpnQueue{ - PartitionCount: 1, - }, - testcontext.Messaging().VPN, - queueName, - nil, - ) - - Eventually(ch).WithTimeout(10 * time.Second).Should(BeClosed()) - - Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - Expect(receiverThree.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - }) - It("rebinds to same partition after reconnect within rebalance delay", func () { - var messagingServices[3]solace.MessagingService - for i := 0; i < 3; i++{ - if i == 2 { - messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder(). - FromConfigurationProvider(helpers.ToxicConfiguration())) - } else { - messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder(). - FromConfigurationProvider(helpers.DefaultConfiguration())) - } - - helpers.ConnectMessagingService(messagingServices[i]) - } - - defer func() { - for i := 0; i < 3; i++{ - helpers.DisconnectMessagingService(messagingServices[i]) - } - }() - - var partitionKeys[9]string - for i := 0; i < 9; i++{ - partitionKeys[i] = "key_"+ strconv.Itoa(i) - } - - publisher := helpers.NewPersistentPublisher(messagingServices[0]) - messageBuilder := messagingServices[0].MessageBuilder() - publisher.Start() - - publisherMetrics := messagingServices[0].Metrics() - publishMessages := func (firstConnectionAttempt bool) { - for i := 0; i < 18; i++{ - msg, _ := messageBuilder.WithProperty(config.MessageProperty(config.QueuePartitionKey), partitionKeys[i % 9]).BuildWithStringPayload("Hi Solace") - publisher.Publish(msg, resource.TopicOf(topicName), nil, nil) - } - - if firstConnectionAttempt { - Eventually(func() uint64 { - return publisherMetrics.GetValue(metrics.TotalMessagesSent) - }).WithTimeout(30 * time.Second).Should(BeNumerically("==", 18)) - } else { - Eventually(func() uint64 { - return publisherMetrics.GetValue(metrics.TotalMessagesSent) - }).WithTimeout(30 * time.Second).Should(BeNumerically("==", 36)) - } - } - - publishMessages(true) - - partitionedQueue := resource.QueueDurableNonExclusive(queueName) - receiverOne, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) - receiverOne.Start() - receiverOnePartitionKeys := make([]string, 0, 18) - receiverOneMessageHandler := func (message message.InboundMessage) { - partitionKey, _ := message.GetProperty("JMSXGroupID") - partitionKeyValue := fmt.Sprint(partitionKey) - receiverOnePartitionKeys = append(receiverOnePartitionKeys, partitionKeyValue) - } - - receiverTwo, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). - WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) - receiverTwo.Start() - receiverTwoMessageHandler := func (message message.InboundMessage){ - fmt.Println("Received message in receiverTwo") - } - - receiverOne.ReceiveAsync(receiverOneMessageHandler) - receiverTwo.ReceiveAsync(receiverTwoMessageHandler) - - receiverOneMetrics := messagingServices[1].Metrics() - receiverTwoMetrics := messagingServices[2].Metrics() - - Eventually( func() uint64 { - totalMessagesReceived := receiverOneMetrics.GetValue(metrics.PersistentMessagesReceived) + receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) - return totalMessagesReceived - }).WithTimeout(30 * time.Second).Should(Equal(publisherMetrics.GetValue(metrics.TotalMessagesSent))) - - partitionKeysBeforeDisconnect := make([]string, len(receiverOnePartitionKeys)) - copy(receiverOnePartitionKeys, partitionKeysBeforeDisconnect) - receiverOnePartitionKeys = receiverOnePartitionKeys[:0] - - reconnectionListenerChan := make(chan struct{}) - messagingServices[2].AddReconnectionListener(func(even solace.ServiceEvent) { - close(reconnectionListenerChan) - }) - - reconnectAttemptListenerChan := make(chan struct{}) - messagingServices[2].AddReconnectionAttemptListener(func(event solace.ServiceEvent) { - testcontext.Toxi().SMF().Enable() - close(reconnectAttemptListenerChan) - }) - - //temporarily disconnect receiverTwo - testcontext.Toxi().SMF().Disable() - - Eventually(reconnectionListenerChan).WithTimeout(30 * time.Second).Should(BeClosed()) - - //republish messages - publishMessages(false) - - Eventually( func() uint64 { - totalMessagesReceived := receiverOneMetrics.GetValue(metrics.PersistentMessagesReceived) + receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) - return totalMessagesReceived - }).WithTimeout(30 * time.Second).Should(BeNumerically(">=", publisherMetrics.GetValue(metrics.TotalMessagesSent))) - - partitionKeysAfterReconnection := make([]string, len(receiverOnePartitionKeys)) - copy(receiverOnePartitionKeys, partitionKeysAfterReconnection) - - Expect(partitionKeysBeforeDisconnect).Should(Equal(partitionKeysAfterReconnection)) - Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) - }) - }) + var queueName string = "partitioned_queue_test" + var topicName string = "partitioned_queue_topic_test" + var rebalanceDelay int64 = 15 + var partitionCount int32 = 3 + Context("queue has three partitions and rebalance delay of 15 seconds", func() { + BeforeEach(func() { + helpers.CreatePartitionedQueue(queueName, partitionCount, rebalanceDelay, topicName) + }) + + AfterEach(func() { + helpers.DeleteQueue(queueName) + }) + + It("should have at least one key assigned to each partition and same keyed messages go to same partition", Label(PQLabel), func() { + var messagingServices [4]solace.MessagingService + var partitionKeys [9]string + var rebalanceDelayDuration = time.Duration(rebalanceDelay) * 2 + + //generate partition keys + for i := 0; i < 9; i++ { + partitionKeys[i] = "key_" + strconv.Itoa(i) + } + + for i := 0; i < 4; i++ { + messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder().FromConfigurationProvider(helpers.DefaultConfiguration())) + helpers.ConnectMessagingService(messagingServices[i]) + } + + defer func() { + for i := 0; i < 4; i++ { + helpers.DisconnectMessagingService(messagingServices[i]) + } + }() + + partitionedQueue := resource.QueueDurableNonExclusive(queueName) + publisher := helpers.NewPersistentPublisher(messagingServices[0]) + + receiverOne, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) + + receiverTwo, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) + + receiverThree, _ := messagingServices[3].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) + + publisher.Start() + receiverOne.Start() + receiverTwo.Start() + receiverThree.Start() + + messageBuilder := messagingServices[0].MessageBuilder() + for i := 0; i < 18; i++ { + msg, _ := messageBuilder.WithProperty(config.MessageProperty(config.QueuePartitionKey), partitionKeys[i%9]).BuildWithStringPayload("Hi Solace") + publisher.Publish(msg, resource.TopicOf(topicName), nil, nil) + } + + publisher.Terminate(rebalanceDelayDuration * time.Second) + + messageHandler := func(message message.InboundMessage) { + fmt.Println("message received") + } + + receiverOne.ReceiveAsync(messageHandler) + receiverTwo.ReceiveAsync(messageHandler) + receiverThree.ReceiveAsync(messageHandler) + + publisherMetrics := messagingServices[0].Metrics() + receiverOneMetrics := messagingServices[1].Metrics() + receiverTwoMetrics := messagingServices[2].Metrics() + receiverThreeMetrics := messagingServices[3].Metrics() + + Eventually(func() uint64 { + return receiverOneMetrics.GetValue(metrics.PersistentMessagesReceived) + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically(">=", 2)) + + Eventually(func() uint64 { + return receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically(">=", 2)) + + Eventually(func() uint64 { + return receiverThreeMetrics.GetValue(metrics.PersistentMessagesReceived) + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically(">=", 2)) + + Eventually(func() uint64 { + totalMessagesReceived := receiverOneMetrics. + GetValue(metrics.PersistentMessagesReceived) + receiverTwoMetrics.GetValue(metrics.PersistentMessagesReceived) + receiverThreeMetrics.GetValue(metrics.PersistentMessagesReceived) + return totalMessagesReceived + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(Equal(publisherMetrics.GetValue(metrics.TotalMessagesSent))) + + Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + Expect(receiverThree.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + }) + + It("generates flow inactive event when no partitions left for consumer to bind", Label(PQLabel), func() { + + var listenerOne solace.ReceiverStateChangeListener + var listenerTwo solace.ReceiverStateChangeListener + var listenerThree solace.ReceiverStateChangeListener + + var rebalanceDelayDuration = time.Duration(rebalanceDelay) * 2 + + var messagingServices [3]solace.MessagingService + + partitionedQueue := resource.QueueDurableNonExclusive(queueName) + + for i := 0; i < 3; i++ { + messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder(). + FromConfigurationProvider(helpers.DefaultConfiguration())) + helpers.ConnectMessagingService(messagingServices[i]) + } + + defer func() { + for i := 0; i < 3; i++ { + helpers.DisconnectMessagingService(messagingServices[i]) + } + }() + //activeStateTransitions refer to start-up induced state changes + //(i.e., receiver transition from passive to active whereas passive transitions are induced on partition downscale + activeStateTransitions, passiveStateTransitions := 0, 0 + ch := make(chan struct{}) + + passiveTransitionIncrementor := func(oldState, newState solace.ReceiverState, timestamp time.Time) { + if oldState == solace.ReceiverActive && newState == solace.ReceiverPassive { + passiveStateTransitions++ + } else { + activeStateTransitions++ + } + + if passiveStateTransitions == 2 && activeStateTransitions == 3 { + close(ch) + } + } + + listenerOne, listenerTwo, listenerThree = passiveTransitionIncrementor, passiveTransitionIncrementor, passiveTransitionIncrementor + + receiverOne, _ := messagingServices[0].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerOne).Build(partitionedQueue) + + receiverTwo, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerTwo).Build(partitionedQueue) + + receiverThree, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).WithActivationPassivationSupport(listenerThree).Build(partitionedQueue) + + Expect(receiverOne.Start()).ToNot(HaveOccurred()) + Expect(receiverTwo.Start()).ToNot(HaveOccurred()) + Expect(receiverThree.Start()).ToNot(HaveOccurred()) + + time.Sleep(rebalanceDelayDuration * time.Second) + + testcontext.SEMP().Config().QueueApi.UpdateMsgVpnQueue( + testcontext.SEMP().ConfigCtx(), + sempconfig.MsgVpnQueue{ + PartitionCount: 1, + }, + testcontext.Messaging().VPN, + queueName, + nil, + ) + + Eventually(ch).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeClosed()) + + Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + Expect(receiverThree.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + }) + It("rebinds to same partition after reconnect within rebalance delay", Label(PQLabel), func() { + var connectionRetries uint = 5 + var intervalDurationSec = time.Duration(2) + var reconnectDurationTimoutSec = time.Duration(connectionRetries) * intervalDurationSec * 2 // should be about 10 secs + rebalanceDelayDuration := time.Duration(rebalanceDelay) * 2 // should be about 20 secs + var messagingServices [3]solace.MessagingService + for i := 0; i < 3; i++ { + messagingServices[i] = helpers.BuildMessagingService(messaging.NewMessagingServiceBuilder(). + FromConfigurationProvider(helpers.DefaultConfiguration()). + WithReconnectionRetryStrategy(config. + RetryStrategyParameterizedRetry(connectionRetries, intervalDurationSec*time.Second))) + + helpers.ConnectMessagingService(messagingServices[i]) + } + + defer func() { + for i := 0; i < 3; i++ { + helpers.DisconnectMessagingService(messagingServices[i]) + } + }() + + var partitionKeys [9]string + for i := 0; i < 9; i++ { + partitionKeys[i] = "key_" + strconv.Itoa(i) + } + + publisher := helpers.NewPersistentPublisher(messagingServices[0]) + messageBuilder := messagingServices[0].MessageBuilder() + publisher.Start() + + publisherMetrics := messagingServices[0].Metrics() + publishMessages := func(firstConnectionAttempt bool) { + for i := 0; i < 18; i++ { + msg, _ := messageBuilder.WithProperty(config.MessageProperty(config.QueuePartitionKey), partitionKeys[i%9]).BuildWithStringPayload("Hi Solace") + publisher.Publish(msg, resource.TopicOf(topicName), nil, nil) + } + + if firstConnectionAttempt { + Eventually(func() uint64 { + return publisherMetrics.GetValue(metrics.TotalMessagesSent) + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically("==", 18)) + } else { + Eventually(func() uint64 { + return publisherMetrics.GetValue(metrics.TotalMessagesSent) + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically("==", 36)) + } + } + + publishMessages(true) + + partitionedQueue := resource.QueueDurableNonExclusive(queueName) + receiverOne, _ := messagingServices[1].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) + var receiverOneMessageCount uint64 = 0 + var receiverTwoMessageCount uint64 = 0 + + receiverOnePartitionKeys := make([]string, 0, 18) + receiverOneMessageHandler := func(message message.InboundMessage) { + // get user property "JMSXGroupID" for partition key + if partitionKey, present := message.GetProperty(config.QueuePartitionKey); present { + partitionKeyValue := partitionKey.(string) + receiverOnePartitionKeys = append(receiverOnePartitionKeys, partitionKeyValue) + } + // must count dispatched message after PKey is recorded to avoid racing with main go routine + receiverOneMessageCount += 1 + } + + receiverTwo, _ := messagingServices[2].CreatePersistentMessageReceiverBuilder(). + WithSubscriptions(resource.TopicSubscriptionOf(topicName)).Build(partitionedQueue) + receiverTwoMessageHandler := func(message message.InboundMessage) { + //fmt.Println("Received message in receiverTwo") + // count the received messages dispatched for the receiver + receiverTwoMessageCount += 1 + } + + receiverOne.ReceiveAsync(receiverOneMessageHandler) + receiverTwo.ReceiveAsync(receiverTwoMessageHandler) + + receiverOne.Start() + receiverTwo.Start() + + Eventually(func() uint64 { + totalMessagesReceived := receiverOneMessageCount + receiverTwoMessageCount + return totalMessagesReceived + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(Equal(publisherMetrics.GetValue(metrics.TotalMessagesSent))) + + numPartitionKeys := len(receiverOnePartitionKeys) + partitionKeysBeforeDisconnect := make([]string, numPartitionKeys) + copy(receiverOnePartitionKeys, partitionKeysBeforeDisconnect) + receiverOnePartitionKeys = receiverOnePartitionKeys[:0] + + reconnectionListenerChan := make(chan struct{}) + messagingServices[2].AddReconnectionListener(func(even solace.ServiceEvent) { + close(reconnectionListenerChan) + }) + + reconnectAttemptListenerChan := make(chan struct{}) + messagingServices[2].AddReconnectionAttemptListener(func(event solace.ServiceEvent) { + close(reconnectAttemptListenerChan) + }) + + //temporarily disconnect receiverTwo + helpers.ForceDisconnectViaSEMPv2(messagingServices[2]) + + Eventually(reconnectionListenerChan).WithTimeout(reconnectDurationTimoutSec * time.Second).Should(BeClosed()) + + //republish messages + publishMessages(false) + + Eventually(func() uint64 { + totalMessagesReceived := receiverOneMessageCount + receiverTwoMessageCount + return totalMessagesReceived + }).WithTimeout(rebalanceDelayDuration * time.Second).Should(BeNumerically(">=", publisherMetrics.GetValue(metrics.TotalMessagesSent))) + + partitionKeysAfterReconnection := make([]string, numPartitionKeys) + copy(receiverOnePartitionKeys, partitionKeysAfterReconnection) + + Expect(partitionKeysBeforeDisconnect).Should(Equal(partitionKeysAfterReconnection)) + Expect(receiverOne.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + Expect(receiverTwo.Terminate(10 * time.Second)).ToNot(HaveOccurred()) + }) + }) }) diff --git a/test/persistent_publisher_test.go b/test/persistent_publisher_test.go index c522478..deee970 100644 --- a/test/persistent_publisher_test.go +++ b/test/persistent_publisher_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/persistent_receiver_test.go b/test/persistent_receiver_test.go index 194dd14..c39a6a3 100644 --- a/test/persistent_receiver_test.go +++ b/test/persistent_receiver_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/rgmid_test.go b/test/rgmid_test.go index 77f032f..d48b341 100644 --- a/test/rgmid_test.go +++ b/test/rgmid_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/sdt_test.go b/test/sdt_test.go index 4b28918..14aabc4 100644 --- a/test/sdt_test.go +++ b/test/sdt_test.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/sempclient/Dockerfile b/test/sempclient/Dockerfile index cab48c4..9dd0305 100644 --- a/test/sempclient/Dockerfile +++ b/test/sempclient/Dockerfile @@ -1,6 +1,6 @@ # pubsubplus-go-client # -# Copyright 2023 Solace Corporation. All rights reserved. +# Copyright 2023-2024 Solace Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/sempclient/makeclean b/test/sempclient/makeclean index 85cd5d7..2807178 100755 --- a/test/sempclient/makeclean +++ b/test/sempclient/makeclean @@ -2,7 +2,7 @@ # pubsubplus-go-client # -# Copyright 2023 Solace Corporation. All rights reserved. +# Copyright 2023-2024 Solace Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/sempclient/semp-client.go b/test/sempclient/semp-client.go index cc87a4f..726818c 100644 --- a/test/sempclient/semp-client.go +++ b/test/sempclient/semp-client.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/solclient_log_debug.go b/test/solclient_log_debug.go index 0f790af..3f672a3 100644 --- a/test/solclient_log_debug.go +++ b/test/solclient_log_debug.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/solclient_log_default.go b/test/solclient_log_default.go index e1c6b26..c27a142 100644 --- a/test/solclient_log_default.go +++ b/test/solclient_log_default.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/config.go b/test/testcontext/config.go index 947c9ba..a6f1f8c 100644 --- a/test/testcontext/config.go +++ b/test/testcontext/config.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/kinit_darwin.go b/test/testcontext/kinit_darwin.go index c471c52..619a898 100644 --- a/test/testcontext/kinit_darwin.go +++ b/test/testcontext/kinit_darwin.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/kinit_linux.go b/test/testcontext/kinit_linux.go index 9eaf0ba..b19a110 100644 --- a/test/testcontext/kinit_linux.go +++ b/test/testcontext/kinit_linux.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/messaging.go b/test/testcontext/messaging.go index c357deb..c24ff56 100644 --- a/test/testcontext/messaging.go +++ b/test/testcontext/messaging.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/semp.go b/test/testcontext/semp.go index 7326919..0dd777a 100644 --- a/test/testcontext/semp.go +++ b/test/testcontext/semp.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import ( "crypto/tls" "fmt" "net/http" + "solace.dev/go/messaging/test/sempclient/action" "solace.dev/go/messaging/test/sempclient/config" "solace.dev/go/messaging/test/sempclient/monitor" diff --git a/test/testcontext/test_context.go b/test/testcontext/test_context.go index f910f01..8a0534f 100644 --- a/test/testcontext/test_context.go +++ b/test/testcontext/test_context.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/test_context_remote.go b/test/testcontext/test_context_remote.go index 8465471..6e0e33c 100644 --- a/test/testcontext/test_context_remote.go +++ b/test/testcontext/test_context_remote.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/test_context_testcontainers.go b/test/testcontext/test_context_testcontainers.go index ea2f493..580f1ab 100644 --- a/test/testcontext/test_context_testcontainers.go +++ b/test/testcontext/test_context_testcontainers.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/testcontext/toxiproxy.go b/test/testcontext/toxiproxy.go index 36f1366..7811471 100644 --- a/test/testcontext/toxiproxy.go +++ b/test/testcontext/toxiproxy.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/version.go b/version.go index 57efa30..2cf33bb 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // pubsubplus-go-client // -// Copyright 2021-2023 Solace Corporation. All rights reserved. +// Copyright 2021-2024 Solace Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,4 +23,4 @@ func init() { core.SetVersion(version) } -const version = "1.4.0" +const version = "1.5.0"