Skip to content

Commit

Permalink
Merge pull request #6 from SolaceDev/dev
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
mcardy authored Oct 31, 2022
2 parents 974efbb + 92c32df commit 25f645f
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: '1.18'
go-version: '1.19'
- name: Compiles
run: go build ./...

Expand All @@ -35,7 +35,7 @@ jobs:
if: ${{ success() }}
run: |
mkdir reports
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/onsi/ginkgo/v2/ginkgo@v2.1.3
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
working-directory: ./test

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ To get started using the Solace PubSub+ API for Go, simply include it as a requi
### OS Support

The Solace PubSub+ API for Go is a wrapper around the high performance Solace C API via Cgo and has support for the following operating systems:
- Linux variants with Linux26-x86_64 GCC or greater [Debian-based (Ubuntu), Windows WSL 2.0, and CentOS/RHEL-based (Red Hat Linux, CentOS) distributions],
- macOS (10.15 and later, x86_64-bit versions)
- Linux (x86/x86_64) variants with Linux 2.6 or later (compatible with glibc (desktop/server) and musl-c (Alpine Linux))
- Windows WSL 2.0
- macOS 10.15 and later (x86_64 versions)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions internal/ccsmp/ccsmp_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func SolClientMessageSetCorrelationID(messageP SolClientMessagePt, correlationID
func SolClientMessageGetApplicationMessageID(messageP SolClientMessagePt) (string, *SolClientErrorInfoWrapper) {
var cChar *C.char
errorInfo := handleCcsmpError(func() SolClientReturnCode {
return C.solClient_msg_getApplicationMsgType(messageP, &cChar)
return C.solClient_msg_getApplicationMessageId(messageP, &cChar)
})
return C.GoString(cChar), errorInfo
}
Expand All @@ -255,7 +255,7 @@ func SolClientMessageSetApplicationMessageID(messageP SolClientMessagePt, msgID
cStr := C.CString(msgID)
defer C.free(unsafe.Pointer(cStr))
errorInfo := handleCcsmpError(func() SolClientReturnCode {
return C.solClient_msg_setApplicationMsgType(messageP, cStr)
return C.solClient_msg_setApplicationMessageId(messageP, cStr)
})
return errorInfo
}
Expand Down
2 changes: 2 additions & 0 deletions internal/ccsmp/includes_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ package ccsmp
#cgo LDFLAGS: -L/usr/local/opt/[email protected]/lib ${SRCDIR}/lib/darwin/libsolclient.a -lssl -lcrypto -framework Kerberos
*/
import "C"

var SolClientRunningOnAlpine bool = false
9 changes: 9 additions & 0 deletions internal/ccsmp/includes_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ package ccsmp
#cgo LDFLAGS: ${SRCDIR}/lib/linux/libsolclient.a -lm -ldl -lpthread -lrt
#include <dlfcn.h>
#include <features.h>
#ifdef __GLIBC__
#define SOLCLIENT_USING_MUSL 0
#else
#define SOLCLIENT_USING_MUSL 1
#endif
*/
import "C"

Expand All @@ -31,3 +38,5 @@ import "C"
func funcToLinkAgainstLibdl() {
C.dlerror()
}

var SolClientRunningOnAlpine bool = C.SOLCLIENT_USING_MUSL == 1
Binary file modified internal/ccsmp/lib/darwin/libsolclient.a
Binary file not shown.
65 changes: 31 additions & 34 deletions internal/ccsmp/lib/include/solclient/solClient.h

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions internal/ccsmp/lib/include/solclient/solClientDeprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @file solClientDeprecated.h include file for the Solace Corporation Messaging API for C
*
* Copyright 2007-2021 Solace Corporation. All rights reserved.
* Copyright 2007-2022 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
Expand Down Expand Up @@ -672,7 +672,7 @@ static const solClient_consumerId_t SOLCLIENT_NULL_CONSUMER_ID = 0xffffffff; /**

/**
* Creates a Queue network name. This function has been deprecated and exists for backwards
* compatiblity.
* compatibility.
*
* This string may be passed as the Queue name to
* ::solClient_session_createFlow() when connecting with a Queue
Expand Down Expand Up @@ -712,7 +712,7 @@ static const solClient_consumerId_t SOLCLIENT_NULL_CONSUMER_ID = 0xffffffff; /**

/**
* Create a temporary Queue name. This function has been deprecated and exists for backwards
* compatiblity.
* compatibility.
*
* The string returned by this function may be passed as the Queue name to
* ::solClient_session_createFlow() when connecting with a non-durable Queue
Expand Down Expand Up @@ -753,7 +753,7 @@ solClient_session_createTemporaryQueueName(solClient_opaqueSession_pt opaqueSess
*
* By default, all Guaranteed messages are stored in the Solace messaging appliance before being forwarded
* (::SOLCLIENT_FLOW_PROP_FORWARDING_MODE_STORE_AND_FORWARD). In this manner, when publishers receive a Guaranteed delivery
* acknowledgment, it is assured that all matching endpoint subscribers can eventually receive the message. Similiarly subscribers currently
* acknowledgment, it is assured that all matching endpoint subscribers can eventually receive the message. Similarly subscribers currently
* unbound from the topic-endpoint or queue, will receive the Guaranteed message after the next bind.
*
* Beginning with release 5.3 of the Solace messaging appliance, it is possible to configure an endpoint connection as
Expand Down
17 changes: 9 additions & 8 deletions internal/ccsmp/lib/include/solclient/solClientMsg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file solClientMsg.h include file for Solace Corporation Messaging Buffer Management
*
* Copyright 2008-2021 Solace Corporation. All rights reserved.
* Copyright 2008-2022 Solace Corporation. All rights reserved.
*/
/** @page msgbuffer Solace Message Buffers
*
Expand Down Expand Up @@ -43,7 +43,7 @@
* @li ReplyTo - a ReplyTo destination.
* @li SenderId - a Sender Identification. This field can be automatically generated when
* the session property
* ::SOLCLIENT_SESSION_PROP_GENERATE_SESSION_ID is enabled. When
* ::SOLCLIENT_SESSION_PROP_GENERATE_SENDER_ID is enabled. When
* this property is enabled, and the SenderId is not explicitly
* set, the session ClientName is used as the SenderId.<br>
* The SenderID is user-defined, carried end-to-end, and can also be matched
Expand Down Expand Up @@ -234,7 +234,7 @@ typedef enum solClient_cacheStatus

/** @name Number of Message Size Quanta
* The number of message size quanta available.
* @see ::SOLCLIENT_GLOBAL_PROP_DBQUANTASIZE_0 through ::SOLCLIENT_GLOBAL_PROP_DBQUANTASIZE_5
* @see ::SOLCLIENT_GLOBAL_PROP_DBQUANTASIZE_0 through ::SOLCLIENT_GLOBAL_PROP_DBQUANTASIZE_4
*/
/*@{*/
#define SOLCLIENT_MSG_NUMDBQUANTA (5) /**< The number of message size quanta available */
Expand Down Expand Up @@ -348,7 +348,7 @@ solClient_msg_reset(solClient_opaqueMsg_pt msg_p);
/**
* Given a msg_p, retrieve the user property Map from binary metadata.
* The returned map is a multimap, in which more than one value may be associated
* with a given field name. A call to ::solClient_container_addXyz() does not
* with a given field name. A call to <i>solClient_container_addXyz()</i> does not
* overwrite an existing one, instead it adds a new field. To overwrite an existing
* field, the field has to been deleted and then added with a new value. To get all
* values associated with a given field name, a linear search is required.
Expand Down Expand Up @@ -398,7 +398,7 @@ solClient_msg_getBinaryAttachmentStream(solClient_opaqueMsg_pt msg_p,
/**
* Given a msg_p, retrieve the contents of a binary attachment part as a map.
* The returned map is a multimap in which more than one value may be associated
* with a given field name. A call to ::solClient_container_addXyz() does not
* with a given field name. A call to <i>solClient_container_addXyz()</i> does not
* overwrite an existing one, but adds a new one instead. To overwrite an existing
* field, the field has to been deleted and then added with a new value. To get all
* values associated with a given field name, a linear search is required.
Expand Down Expand Up @@ -1725,6 +1725,7 @@ solClient_msg_isReplyMsg(solClient_opaqueMsg_pt msg_p);
* Given a msg_p, set the Dead Message Queue (DMQ) eligible property on a message. When this
* option is set, messages that expire in the network, are saved on a appliance dead message
* queue. Otherwise expired messages are discarded.
* By default the property is set to false on newly created messages.
*
* @param msg_p A solClient_opaqueMsg_pt that is returned from a previous call
* to solClient_msg_alloc() or received in a receive
Expand Down Expand Up @@ -1874,7 +1875,7 @@ solClient_msg_isElidingEligible(solClient_opaqueMsg_pt msg_p);
/**
* Create a map container in the binary attachment of the message.
* The map is a multimap in which more than one value may be associated
* with a given field name. A call to ::solClient_container_addXyz() does not
* with a given field name. A call to <i>solClient_container_addXyz()</i> does not
* overwrite an existing one, but adds a new one instead. To overwrite an existing
* field, the field has to been deleted and then added with a new value. To get all
* values associated with a given field name, a linear search is required.
Expand Down Expand Up @@ -1951,7 +1952,7 @@ solClient_msg_createBinaryAttachmentStream(solClient_opaqueMsg_pt msg_p,
/**
* Create a User Property map in the binary metadata header.
* The map is a multimap in which more than one value may be associated
* with a given field name. A call to ::solClient_container_addXyz() does not
* with a given field name. A call to <i>solClient_container_addXyz()</i> does not
* overwrite an existing one, but adds a new one instead. To overwrite an existing
* field, the field has to been deleted and then added with a new value. To get all
* values associated with a given field name, a linear search is required.
Expand Down Expand Up @@ -2263,7 +2264,7 @@ solClient_msg_deleteHttpContentEncoding(solClient_opaqueMsg_pt msg_p);
* SOLCLIENT_SUBCODE_INSUFFICIENT_SPACE.
* The map is a multimap in which more than one value may be associated with a given field
* name.
* A call to ::solClient_container_addXyz() does not
* A call to <i>solClient_container_addXyz()</i> does not
* overwrite an existing field, instead it adds a new one. To overwrite an existing
* field, the field has to been deleted and then added with a new value. To get all
* values associated with a given field name, a linear search is required.
Expand Down
Binary file modified internal/ccsmp/lib/linux/libsolclient.a
Binary file not shown.
3 changes: 2 additions & 1 deletion internal/impl/core/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func ToNativeError(err ErrorInfo, args ...string) error {
subcode.ReplayLogModified,
subcode.MismatchedEndpointErrorID,
subcode.OutOfReplayResources,
subcode.ReplayStartMessageUnavailable:
subcode.ReplayStartMessageUnavailable,
subcode.ReplayAnonymousNotSupported:
return solace.NewError(&solace.MessageReplayError{}, err.GetMessageAsString(), nativeError)
default:
return nativeError
Expand Down
5 changes: 5 additions & 0 deletions internal/impl/core/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ var libraryEnvironmentMapping = map[string]string{
// ccsmp initialization, calls solClient_initialize
func init() {
propertyMap := make(map[string]string)
if ccsmp.SolClientRunningOnAlpine {
// SOL-78608 we need to use the full library names to pick up the default alpine SSL libs
propertyMap[ccsmp.SolClientGlobalPropCryptoLib] = "libcrypto.so.1.1"
propertyMap[ccsmp.SolClientGlobalPropSslLib] = "libssl.so.1.1"
}
for _, env := range supportedKeys {
if val, ok := os.LookupEnv(env); ok {
var key string
Expand Down
6 changes: 4 additions & 2 deletions pkg/solace/subcode/subcode_generated.go

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

2 changes: 1 addition & 1 deletion test/data/config/config_testcontainers.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"testcontainers": {
"broker_hostname": "solbroker",
"broker_tag": "9.13.0.16",
"broker_tag": "9.13",
"broker_repo": "solace/solace-pubsub",
"broker_edition": "standard",
"toxiproxy_hostname": "toxiproxy",
Expand Down
14 changes: 14 additions & 0 deletions test/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,20 @@ var _ = Describe("Local MessageBuilder Tests", func() {
for builderName, builderFuncRef := range buildFunctions {
builderFunc := builderFuncRef
Context("using build "+builderName, func() {
It("can set and retrieve all message options", func() {
for _, configProvider := range fromConfigProviderTestCases {
messageBuilder.FromConfigurationProvider(config.MessagePropertyMap{configProvider.key: configProvider.value})
}
msg, err := builderFunc(messageBuilder)
Expect(err).ToNot(HaveOccurred())
for _, configProvider := range fromConfigProviderTestCases {
retrieved, ok := configProvider.getter(msg)
Expect(ok).To(BeTrue())
Expect(retrieved).To(BeEquivalentTo(configProvider.value))
}
msg.Dispose()
})

for _, testCase := range fromConfigProviderTestCases {
key := testCase.key
value := testCase.value
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ func init() {
core.SetVersion(version)
}

const version = "1.0.1"
const version = "1.1.0"

0 comments on commit 25f645f

Please sign in to comment.