Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release v1.7.0 #22

Merged
merged 89 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
15283b5
Swapping in the ccsmp_eol_openssl_1.1.1 CCSMP build. Not bumping the …
Apr 24, 2024
14ae7bd
Removing openssl version restriction.
Apr 24, 2024
15651f8
CCSMP update script tweak. Mainly to trigger a build.
Apr 25, 2024
437690e
SOL-117804: tweaking test skip to avoid before and after test executi…
cjwmorgan-sol May 6, 2024
ccd0708
Version bump to 1.6.2
cjwmorgan-sol May 6, 2024
3245135
Merge pull request #51 from SolaceDev/skip_test_execution
oodigie May 6, 2024
0e3c9ad
Merge pull request #52 from SolaceProducts/main
gszol Jun 5, 2024
6c799ce
Updating CCSMP from trunk in preparation to merge.
Jun 5, 2024
f571ff0
Can't confuse our hordes of open source contributors!
Jun 5, 2024
7500381
Merge pull request #53 from SolaceDev/SOL-117019
oodigie Jun 6, 2024
7227372
feat: bumped the ccsmp lib to 7.30.0.2
oodigie Jun 18, 2024
6933eb0
feat: Added new user visible ServiceProperty to the messaging service…
oodigie Jun 18, 2024
67aacfc
feat: Added the required integration tests for the payload compressio…
oodigie Jun 26, 2024
20c9d11
Merge pull request #54 from SolaceDev/SOL-117402--SOL-120248
oodigie Jul 2, 2024
7aa69ea
SOL-121555: Added support for the new ProvisionTimeoutMs session prop…
oodigie Jul 9, 2024
ff04cd1
SOL-121556: Golang: Implement code changes to support the endpoint pr…
oodigie Aug 2, 2024
b48f853
feat[SOL-121556]: fixed failing tests
oodigie Aug 2, 2024
0af50c3
SOL-121557: Golang: Implement the endpoint deprovision feature
oodigie Aug 2, 2024
5d7c0cf
feat: fixed the permission type conversion and updated the endpoint p…
oodigie Aug 6, 2024
b4600cf
feat: fixed the failing unit tests
oodigie Aug 6, 2024
31e4d72
feat: added some more unit tests
oodigie Aug 6, 2024
b211e34
build: added step to install docker-compose v1 in Git actions
oodigie Aug 6, 2024
aeca446
build: removed the pegged version so we install the latest docker-com…
oodigie Aug 6, 2024
f5af412
build: pegged version to the latest docker-compose
oodigie Aug 6, 2024
8502ffa
Merge pull request #57 from SolaceDev/fix-git-actions
cjwmorgan-sol Aug 6, 2024
57a2af5
Merge branch 'dev' into SOL-120490--SOL-121556
oodigie Aug 6, 2024
c5cdb62
chore: removed some unneccessary comments from some tests
oodigie Aug 7, 2024
e85d226
feat[SOL-121560]: wrote integration tests to provide 100% coverage fo…
oodigie Aug 9, 2024
66df9b2
feat: fixed all the comments raised on the PR
oodigie Aug 9, 2024
e26f7dd
test: included all the endpoint properties in the serialization unit …
oodigie Aug 12, 2024
dd93e15
test: updated the name of the integration test to better describe it
oodigie Aug 12, 2024
c6354a8
feat: updated the Provision() and Deprovision() methods to return an …
oodigie Aug 13, 2024
479a53f
feat: removed the truthy check for endpoint durability and delegated …
oodigie Aug 16, 2024
880788e
test: fixed the unstable tests, removed the unnecessary assertion in …
oodigie Aug 16, 2024
d0a10a6
Merge pull request #56 from SolaceDev/SOL-120490--SOL-121556
cjwmorgan-sol Aug 16, 2024
7e2fdc9
Merge pull request #55 from SolaceDev/SOL-98124
oodigie Aug 22, 2024
0d7c0c3
test: updated a test helper function to fix a race condition in a test
oodigie Aug 22, 2024
bf38824
Merge pull request #60 from SolaceDev/fix_test_race_condition
oodigie Aug 22, 2024
a8f5edc
test: ignored failing tests to isolate the failure
oodigie Sep 3, 2024
e18215a
test: ignored more test cases to isolate the failure
oodigie Sep 3, 2024
31789a7
SOL-95364: Added test to verify that the CCSMP subcode 164 is mapped
TrentDaniel Sep 4, 2024
3a84a43
SOL-116360: Fixed terminaton test. Changed how queue is deleted so that
TrentDaniel Sep 6, 2024
dbe28e1
SOL-95364: Fixed typo in test name where changed test was hardcoded to
TrentDaniel Sep 10, 2024
5c90def
SOL-124616: potential fix for the paniced test on the musl linux node
oodigie Sep 11, 2024
9deac7f
SOL-124616: trying to isolate the test case that causes the paniced o…
oodigie Sep 12, 2024
a81272f
SOL-124616: trying to isolate the test case that causes the paniced o…
oodigie Sep 12, 2024
cc267c9
SOL-124616: fix for upload-artifact github action
oodigie Sep 12, 2024
e2934fa
SOL-124616: added comment on test case that cause pipeline to panic
oodigie Sep 12, 2024
251e879
SOL-124616: commented out an unstable test case
oodigie Sep 12, 2024
16fde5f
SOL-124616: currently failing in Jenkins pipeline on Linux Musl nodes
oodigie Sep 12, 2024
deb86a6
SOL-124616: marked the unstable tests with the flaky-tests label
oodigie Sep 12, 2024
08c679c
Merge pull request #61 from SolaceDev/SOL-124616
cjwmorgan-sol Sep 13, 2024
2601def
SOL-106478: merged changes from dev into this branch
oodigie Sep 15, 2024
69ce76f
Merge branch 'dev' into SOL-95364
TrentDaniel Sep 18, 2024
5308b0d
Merge branch 'dev' into SOL-116360
TrentDaniel Sep 18, 2024
a627bc8
EBP-45: fix for the Go api intermittent request reply publisher termi…
oodigie Sep 20, 2024
fd96918
Merge pull request #64 from SolaceDev/EBP-45
cjwmorgan-sol Sep 20, 2024
33a49ba
SOL-95364: Removed print statements that were used for debugging in r…
TrentDaniel Sep 23, 2024
259aa1d
SOL-95364: Removed debug log from test
TrentDaniel Sep 23, 2024
690f4d9
SOL-95364: Fixed formatting
TrentDaniel Sep 23, 2024
b419a2b
SOL-116360: Formatted code changes. Removed dead comment from test.
TrentDaniel Sep 23, 2024
4027fbb
SOL-116360: Fixed test in response to PR feedback.
TrentDaniel Sep 24, 2024
196bc98
SOL-116360: Fixed white space and changed sleep to poll.
TrentDaniel Sep 24, 2024
e325c1f
Merge pull request #62 from SolaceDev/SOL-116360
oodigie Sep 25, 2024
96ab566
merged changes from dev into this branch
oodigie Sep 26, 2024
3f3fa3c
SOL-95364: Added helper function that resolves host name from queues …
TrentDaniel Sep 30, 2024
ae3e41a
SOL-95364: Updated test to use queue-based host resolution instead of…
TrentDaniel Sep 30, 2024
9ca72eb
Merge pull request #63 from SolaceDev/SOL-95364
TrentDaniel Sep 30, 2024
379710f
SOL-125324: document that error returned when number of outstanding p…
oodigie Sep 30, 2024
d66a602
SOL-125324: document that error returned when number of outstanding p…
oodigie Sep 30, 2024
c85bdc1
SOL-126461: Updated Go API to CCSMP version 7.31.0.
TrentDaniel Oct 4, 2024
41e7441
Merge branch 'dev' into SOL-106478
oodigie Oct 8, 2024
3475cf7
SOL-126461: Pinned Go versions in Jenkinsfile to try and fix test com…
TrentDaniel Oct 8, 2024
f35a991
Merge pull request #59 from SolaceDev/SOL-106478
oodigie Oct 9, 2024
72bd916
SOL-126461: Corrected pinned GoLang version string.
TrentDaniel Oct 9, 2024
5f05b44
SOL-98116/EBP-43: Changed internal error struct used for GetLastError…
TrentDaniel Oct 9, 2024
ca488ad
Merge branch 'dev' into SOL-98116
TrentDaniel Oct 9, 2024
4ff28d1
SOL-98116/EBP-43: Fixed nil check in GetMessageAsString() and undid p…
TrentDaniel Oct 10, 2024
4dedc60
SOL-126461: Updated Go API to 7.31.0.7.
TrentDaniel Oct 11, 2024
2161ae7
SOL-98116/EBP-43: Made changes in response to PR feedback. Removed du…
TrentDaniel Oct 15, 2024
9cc2e55
SOL-98116/EBP-43: Made changes in response to feedback: Changed funct…
TrentDaniel Oct 15, 2024
02d2ff2
SOL-98116/EBP-43: Fixed comment typo.
TrentDaniel Oct 15, 2024
ea18817
Merge pull request #67 from SolaceDev/SOL-98116
cjwmorgan-sol Oct 21, 2024
fd37845
pinned the go version for the linux musl node to 1.22.4
oodigie Oct 21, 2024
dc97a2b
fixed a typo in the permutations variable name
oodigie Oct 21, 2024
6fdf455
re-enabled the skipped test for the linux musl node
oodigie Oct 21, 2024
2c0befe
Merge pull request #68 from SolaceDev/EBP-46
cjwmorgan-sol Oct 22, 2024
b5e029a
Merge branch 'dev' into SOL-126461
TrentDaniel Oct 22, 2024
2f864c6
Merge pull request #65 from SolaceDev/SOL-126461
TrentDaniel Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ jobs:
run: go test -coverprofile ./unitcoverage.out ./...
- name: Uploads artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: |
./unitcoverage.out
overwrite: true

# this job runs linux based tests
Linux:
Expand All @@ -39,6 +40,11 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install Compose
uses: ndeloof/[email protected]
with:
version: v2.29.1 # pinned to 'latest' as of 06/08/2024
legacy: true # will also install in PATH as `docker-compose`
- name: Setup Go environment
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -104,16 +110,17 @@ jobs:
run: |
mkdir reports
go install github.com/onsi/ginkgo/v2/[email protected]
ginkgo --junit-report=./reports/report.xml -coverprofile ./reports/coverage.out -coverpkg solace.dev/go/messaging/internal/...,solace.dev/go/messaging/pkg/... -tags enable_debug_logging
ginkgo --junit-report=./reports/report.xml -coverprofile ./reports/coverage.out -coverpkg solace.dev/go/messaging/internal/...,solace.dev/go/messaging/pkg/... -tags enable_debug_logging --label-filter='!flaky-test'
working-directory: ./test

- name: Uploads artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: |
./unitcoverage.out
./test/reports/report.xml
./test/reports/coverage.out
./test/diagnostics.tgz
overwrite: true

6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ builder.goapi([
"validationGoVer": 'auto-v1.17.x',
"getTestPermutations": {
List<List<String>> permutations = []
for (platform in [builder.LINUX_ARM, builder.LINUX_X86_64, builder.LINUX_MUSL, builder.DARWIN_X86_64, builder.DARWIN_ARM]) {
for (platform in [builder.LINUX_ARM, builder.LINUX_X86_64, builder.DARWIN_X86_64, builder.DARWIN_ARM]) {
for (gover in ['auto-latest', 'auto-previous']) {
permutations << [platform, gover]
}
}
// run tests on the last stable Go version (1.22.4) for linux musl
// See EBP-46
// and this issue here - https://go-review.googlesource.com/c/go/+/600296
permutations << [builder.LINUX_MUSL, 'auto-v1.22.4']
return permutations
}
])
4 changes: 2 additions & 2 deletions internal/ccsmp/ccsmp_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (opaqueContainer *SolClientOpaqueContainer) SolClientContainerGetNextField(
if errorInfo != nil {
// we expect and end of stream, but an error is logged if we fail
if errorInfo.ReturnCode == SolClientReturnCodeFail {
logging.Default.Debug(fmt.Sprintf("ccsmp.SolClientContainerGetNextField: Unable to retrieve next field: %s, subcode: %d", errorInfo.GetMessageAsString(), errorInfo.SubCode))
logging.Default.Debug(fmt.Sprintf("ccsmp.SolClientContainerGetNextField: Unable to retrieve next field: %s, subcode: %d", errorInfo.GetMessageAsString(), errorInfo.SubCode()))
}
return "", fieldT, false
}
Expand All @@ -172,7 +172,7 @@ func (opaqueContainer *SolClientOpaqueContainer) SolClientContainerGetField(key
if errorInfo != nil {
// we expect and end of stream, but an error is logged if we fail
if errorInfo.ReturnCode == SolClientReturnCodeFail {
logging.Default.Debug(fmt.Sprintf("ccsmp.SolClientContainerGetField: unable to retrieve next field: %s, subcode: %d", errorInfo.GetMessageAsString(), errorInfo.SubCode))
logging.Default.Debug(fmt.Sprintf("ccsmp.SolClientContainerGetField: unable to retrieve next field: %s, subcode: %d", errorInfo.GetMessageAsString(), errorInfo.SubCode()))
}
return fieldT, false
}
Expand Down
118 changes: 100 additions & 18 deletions internal/ccsmp/ccsmp_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,46 @@ type SolClientResponseCode = C.solClient_session_responseCode_t
// SolClientErrorInfoWrapper is assigned a value
type SolClientErrorInfoWrapper C.solClient_errorInfo_wrapper_t

// SolClientErrorInfoWrapperDetailed is assigned a value
type SolClientErrorInfoWrapperDetailed C.solClient_errorInfo_t

func (info *SolClientErrorInfoWrapper) String() string {
if info == nil {
return ""
}
return fmt.Sprintf("{ReturnCode: %d, SubCode: %d, ResponseCode: %d, ErrorStr: %s}", info.ReturnCode, info.SubCode, info.ResponseCode, info.GetMessageAsString())
if info.DetailedErrorInfo == nil {
return fmt.Sprintf("{ReturnCode: %d, SubCode: nil, ResponseCode: nil, ErrorStr: nil}", info.ReturnCode)
}
detailedErrorInfo := *(info.DetailedErrorInfo)
return fmt.Sprintf("{ReturnCode: %d, SubCode: %d, ResponseCode: %d, ErrorStr: %s}",
info.ReturnCode,
detailedErrorInfo.subCode,
detailedErrorInfo.responseCode,
info.GetMessageAsString())
}

// GetMessageAsString function outputs a string
func (info *SolClientErrorInfoWrapper) GetMessageAsString() string {
if len(info.ErrorStr) == 0 {
if info.DetailedErrorInfo == nil || len(info.DetailedErrorInfo.errorStr) == 0 {
return ""
}
return C.GoString((*C.char)(&info.ErrorStr[0]))
return C.GoString((*C.char)(&info.DetailedErrorInfo.errorStr[0]))
}

// SubCode function returns subcode if available
func (info *SolClientErrorInfoWrapper) SubCode() SolClientSubCode {
if info.DetailedErrorInfo != nil {
return (*(info.DetailedErrorInfo)).subCode
}
return SolClientSubCode(0)
}

// ResponseCode function returns response code if available
func (info *SolClientErrorInfoWrapper) ResponseCode() SolClientResponseCode {
if info.DetailedErrorInfo != nil {
return (*(info.DetailedErrorInfo)).responseCode
}
return SolClientResponseCode(0)
}

// Definition of structs returned from this package to be used externally
Expand Down Expand Up @@ -415,6 +442,21 @@ func (session *SolClientSession) SolClientSessionUnsubscribe(topic string, dispa
return session.solClientSessionUnsubscribeWithFlags(topic, C.SOLCLIENT_SUBSCRIBE_FLAGS_REQUEST_CONFIRM, dispatchID, correlationID)
}

// SolClientEndpointUnsusbcribe wraps solClient_session_endpointTopicUnsubscribe
func (session *SolClientSession) SolClientEndpointUnsusbcribe(properties []string, topic string, correlationID uintptr) *SolClientErrorInfoWrapper {
return handleCcsmpError(func() SolClientReturnCode {
cString := C.CString(topic)
defer C.free(unsafe.Pointer(cString))
endpointProps, endpointFree := ToCArray(properties, true)
defer endpointFree()
return C.SessionTopicEndpointUnsubscribeWithFlags(session.pointer,
endpointProps,
C.SOLCLIENT_SUBSCRIBE_FLAGS_REQUEST_CONFIRM,
cString,
C.solClient_uint64_t(correlationID))
})
}

// SolClientEndpointProvision wraps solClient_session_endpointProvision
func (session *SolClientSession) SolClientEndpointProvision(properties []string) *SolClientErrorInfoWrapper {
return handleCcsmpError(func() SolClientReturnCode {
Expand All @@ -424,29 +466,54 @@ func (session *SolClientSession) SolClientEndpointProvision(properties []string)
})
}

// SolClientEndpointUnsusbcribe wraps solClient_session_endpointTopicUnsubscribe
func (session *SolClientSession) SolClientEndpointUnsusbcribe(properties []string, topic string, correlationID uintptr) *SolClientErrorInfoWrapper {
// SolClientEndpointProvisionWithFlags wraps solClient_session_endpointProvision
func (session *SolClientSession) SolClientEndpointProvisionWithFlags(properties []string, flags C.solClient_uint32_t, correlationID uintptr) *SolClientErrorInfoWrapper {
return handleCcsmpError(func() SolClientReturnCode {
cString := C.CString(topic)
defer C.free(unsafe.Pointer(cString))
endpointProps, endpointFree := ToCArray(properties, true)
defer endpointFree()
return C.SessionTopicEndpointUnsubscribeWithFlags(session.pointer,
return C.SessionEndpointProvisionWithFlags(session.pointer,
endpointProps,
C.SOLCLIENT_SUBSCRIBE_FLAGS_REQUEST_CONFIRM,
cString,
flags,
C.solClient_uint64_t(correlationID))
})
}

// SolClientEndpointDeprovisionWithFlags wraps solClient_session_endpointDeprovision
func (session *SolClientSession) SolClientEndpointDeprovisionWithFlags(properties []string, flags C.solClient_uint32_t, correlationID uintptr) *SolClientErrorInfoWrapper {
return handleCcsmpError(func() SolClientReturnCode {
endpointProps, endpointFree := ToCArray(properties, true)
defer endpointFree()
return C.SessionEndpointDeprovisionWithFlags(session.pointer,
endpointProps,
flags,
C.solClient_uint64_t(correlationID))
})
}

// SolClientEndpointProvisionAsync wraps solClient_session_endpointProvision
func (session *SolClientSession) SolClientEndpointProvisionAsync(properties []string, correlationID uintptr, ignoreExistErrors bool) *SolClientErrorInfoWrapper {
if ignoreExistErrors {
return session.SolClientEndpointProvisionWithFlags(properties, C.SOLCLIENT_PROVISION_FLAGS_IGNORE_EXIST_ERRORS, correlationID)
}
return session.SolClientEndpointProvisionWithFlags(properties, 0x0, correlationID) // no flag pass here
}

// SolClientEndpointDeprovisionAsync wraps solClient_session_endpointDeprovision
func (session *SolClientSession) SolClientEndpointDeprovisionAsync(properties []string, correlationID uintptr, ignoreMissingErrors bool) *SolClientErrorInfoWrapper {
if ignoreMissingErrors {
return session.SolClientEndpointDeprovisionWithFlags(properties, C.SOLCLIENT_PROVISION_FLAGS_IGNORE_EXIST_ERRORS, correlationID)
}
return session.SolClientEndpointDeprovisionWithFlags(properties, 0x0, correlationID) // no flag pass here
}

// SolClientSessionGetRXStat wraps solClient_session_getRxStat
func (session *SolClientSession) SolClientSessionGetRXStat(stat SolClientStatsRX) (value uint64) {
err := handleCcsmpError(func() SolClientReturnCode {
return C.solClient_session_getRxStat(session.pointer, C.solClient_stats_rx_t(stat), (C.solClient_stats_pt)(unsafe.Pointer(&value)))
})
// we should not in normal operation encounter an error fetching stats, but just in case...
if err != nil {
logging.Default.Warning("Encountered error loading core rx stat: " + err.GetMessageAsString() + ", subcode " + fmt.Sprint(err.SubCode))
logging.Default.Warning("Encountered error loading core rx stat: " + err.GetMessageAsString() + ", subcode " + fmt.Sprint(err.SubCode()))
}
return value
}
Expand All @@ -457,7 +524,7 @@ func (session *SolClientSession) SolClientSessionGetTXStat(stat SolClientStatsTX
return C.solClient_session_getTxStat(session.pointer, C.solClient_stats_tx_t(stat), (C.solClient_stats_pt)(unsafe.Pointer(&value)))
})
if err != nil {
logging.Default.Warning("Encountered error loading core stat: " + err.GetMessageAsString() + ", subcode " + fmt.Sprint(err.SubCode))
logging.Default.Warning("Encountered error loading core stat: " + err.GetMessageAsString() + ", subcode " + fmt.Sprint(err.SubCode()))
}
return value
}
Expand Down Expand Up @@ -581,17 +648,28 @@ func NewSessionReplyDispatch(id uint64) uintptr {
return uintptr(id)
}

// GetLastErrorInfoReturnCodeOnly returns a SolClientErrorInfoWrapper with only the ReturnCode field set.
// This adds a function call on failure paths, but we'd be passing strings around in that case anyways and it should
// happen rarely, so it's fine to slow it down a bit more if it means avoiding code duplication. See this function's
// usage in GetLastErrorInfo() and handleCcsmpError to see where the duplicated code would otherwise have been.
func GetLastErrorInfoReturnCodeOnly(returnCode SolClientReturnCode) *SolClientErrorInfoWrapper {
errorInfo := &SolClientErrorInfoWrapper{}
errorInfo.ReturnCode = returnCode
return errorInfo
}

// GetLastErrorInfo should NOT be called in most cases as it is dependent on the thread.
// Unless you know that the goroutine running the code will not be interrupted, do NOT
// call this function!
func GetLastErrorInfo(returnCode SolClientReturnCode) *SolClientErrorInfoWrapper {
errorInfo := &SolClientErrorInfoWrapper{}
errorInfo.ReturnCode = returnCode
errorInfo := GetLastErrorInfoReturnCodeOnly(returnCode)
if returnCode != SolClientReturnCodeNotFound {
detailedErrorInfo := C.solClient_errorInfo_t{}
solClientErrorInfoPt := C.solClient_getLastErrorInfo()
errorInfo.SubCode = solClientErrorInfoPt.subCode
errorInfo.ResponseCode = solClientErrorInfoPt.responseCode
C.strcpy((*C.char)(&errorInfo.ErrorStr[0]), (*C.char)(&solClientErrorInfoPt.errorStr[0]))
detailedErrorInfo.subCode = solClientErrorInfoPt.subCode
detailedErrorInfo.responseCode = solClientErrorInfoPt.responseCode
C.strcpy((*C.char)(&detailedErrorInfo.errorStr[0]), (*C.char)(&solClientErrorInfoPt.errorStr[0]))
errorInfo.DetailedErrorInfo = &detailedErrorInfo
}
return errorInfo
}
Expand All @@ -609,8 +687,12 @@ func handleCcsmpError(f func() SolClientReturnCode) *SolClientErrorInfoWrapper {
defer runtime.UnlockOSThread()

returnCode := f()
if returnCode != SolClientReturnCodeOk && returnCode != SolClientReturnCodeInProgress {
if returnCode == SolClientReturnCodeFail || returnCode == SolClientReturnCodeNotReady {
// Return full error struct if rc requires additional error info.
return GetLastErrorInfo(returnCode)
} else if returnCode != SolClientReturnCodeOk && returnCode != SolClientReturnCodeInProgress {
// Return partial error if not ok but not failure so that caller can parse on rc
return GetLastErrorInfoReturnCodeOnly(returnCode)
}
return nil
}
Expand Down
35 changes: 35 additions & 0 deletions internal/ccsmp/ccsmp_endpoint_permissions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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 "solclient/solClient.h"
*/
import "C"

const (
// SolClientEndpointPermissionNone: with no permissions
SolClientEndpointPermissionNone = C.SOLCLIENT_ENDPOINT_PERM_NONE
// SolClientEndpointPermissionReadOnly: with read-only permission
SolClientEndpointPermissionReadOnly = C.SOLCLIENT_ENDPOINT_PERM_READ_ONLY
// SolClientEndpointPermissionConsume: with consume permission
SolClientEndpointPermissionConsume = C.SOLCLIENT_ENDPOINT_PERM_CONSUME
// SolClientEndpointPermissionTopic: with Modify Topic permission
SolClientEndpointPermissionModifyTopic = C.SOLCLIENT_ENDPOINT_PERM_MODIFY_TOPIC
// SolClientEndpointPermissionDelete: with Delete (all) permissions
SolClientEndpointPermissionDelete = C.SOLCLIENT_ENDPOINT_PERM_DELETE
)
2 changes: 1 addition & 1 deletion internal/ccsmp/ccsmp_endpoint_prop_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions internal/ccsmp/ccsmp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,29 @@ SessionTopicEndpointUnsubscribeWithFlags( solClient_opaqueSession_pt opaqueSess
topicSubscription_p,
(void *)correlationTag);
}

solClient_returnCode_t
SessionEndpointProvisionWithFlags( solClient_opaqueSession_pt opaqueSession_p,
solClient_propertyArray_pt endpointProps,
solClient_uint32_t flags,
solClient_uint64_t correlationTag)
{
return solClient_session_endpointProvision( endpointProps,
opaqueSession_p,
flags,
(void *)correlationTag,
NULL,
0);
}

solClient_returnCode_t
SessionEndpointDeprovisionWithFlags( solClient_opaqueSession_pt opaqueSession_p,
solClient_propertyArray_pt endpointProps,
solClient_uint32_t flags,
solClient_uint64_t correlationTag)
{
return solClient_session_endpointDeprovision( endpointProps,
opaqueSession_p,
flags,
(void *)correlationTag);
}
16 changes: 13 additions & 3 deletions internal/ccsmp/ccsmp_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
typedef struct solClient_errorInfo_wrapper
{
solClient_returnCode_t ReturnCode;
solClient_subCode_t SubCode;
solClient_session_responseCode_t ResponseCode;
char ErrorStr[SOLCLIENT_ERRORINFO_STR_SIZE];
solClient_errorInfo_t * DetailedErrorInfo;
} solClient_errorInfo_wrapper_t;

/**
Expand Down Expand Up @@ -101,6 +99,18 @@ solClient_returnCode_t SessionTopicEndpointUnsubscribeWithFlags(
const char *topicSubscription_p,
solClient_uint64_t correlationTag);

solClient_returnCode_t SessionEndpointProvisionWithFlags(
solClient_opaqueSession_pt opaqueSession_p,
solClient_propertyArray_pt endpointProps,
solClient_uint32_t flags,
solClient_uint64_t correlationTag);

solClient_returnCode_t SessionEndpointDeprovisionWithFlags(
solClient_opaqueSession_pt opaqueSession_p,
solClient_propertyArray_pt endpointProps,
solClient_uint32_t flags,
solClient_uint64_t correlationTag);

/**
* Definition of solclientgo correlation prefix
*/
Expand Down
Loading
Loading