* Initial attempt at a Rust AMQP stack, merged against feature/rust_amqp for now. (#5942) * Enabled building AMQP *without* uAMQP * Start integrating Rust AMQP Value to C++ AMQP Value * AMQP Value tests now pass * Moved AmqpValueType ostream inserter to its original location * Added Rust AMQP Message implementation * Added start of message source tests * Enabled building AMQP *without* uAMQP * Start integrating Rust AMQP Value to C++ AMQP Value * Moved AmqpValueType ostream inserter to its original location * Message target support * Message source and target support * Add connection support; restructured tests to fail on RUST AMQP rather than attempting to run; removed some uAMQP-only features (#5986) * Checkpoint of connection logic * Started implementing Rust based Connection by pulling out uAMQP artifacts * Implemented AMQP Connection in Rust; started API surface refactoring for Rust APIs; Refactored tests to remove some uAMQP only elements. * Don't leak runtime context on calls * Refactor AMQP logic to better isolate rust AMQP code from uAMQP code. (#6008) * refactor uAMQP and Rust AMQP into separate implementations for ease of use * Add connection support; restructured tests to fail on RUST AMQP rather than attempting to run; removed some uAMQP-only features (#5986) * Checkpoint of connection logic * Started implementing Rust based Connection by pulling out uAMQP artifacts * Implemented AMQP Connection in Rust; started API surface refactoring for Rust APIs; Refactored tests to remove some uAMQP only elements. * Don't leak runtime context on calls * export UUID from AMQP * Cleaned up some more elements; reduced scope of doxygen significantly * runtime context needs to be process global not thread global; all tests pass or fail at this point * Merged main into branch * Implement AMQP Session APIs in Rust. (#6033) * Checkpoint of rust session support * Session begin/end now works * Session tests pass * Removed accidental regression * Added rust per-call context (#6043) * Reworked runtime context to be call context * Added context parameter to blocking AMQP calls * Added comments around the lifetime of the RustRuntimeContext captured in the CallContext object * uAMQP changes corresponding to Rust changes Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * sync rust SDK fixes to C++ --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * Enable Rust ClaimsBasedSecurity interoperability; Converted EventHubs producer client to work with Rust AMQP changes. (#6059) * canonicalized return values; initial CBS support * Implementation of CBS for C++ * Amqp Authentication works; Integrate Rust AMQP into Eventhubs Producer client * Implemented Rust AMQP message sender. (#6083) * Initial sender implementation * PR feedback * Management APIs work (#6096) * Management APIs work --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * Converted builders to be compliant with Rust guidelines. (#6102) * Converted builders to be compliant with Rust guidelines. * Bring rust changes back to C++ repo * Improved builder developer experience * Removed builders from AMQP layer to conform to Rust guidelines; Fixed AMQP bug in message sender tests (#6208) * Removed builders from AMQP layer to conform to Rust guidelines; Fixed AMQP related bug in message sender tests * Pr feedback * Implement receiving messages; Changes to eventhubs so that all eventhubs tests pass (#6254) * Eventhubs tests pass * Noise reduction; explain the task which spawns a task * Update sdk/eventhubs/azure-messaging-eventhubs/src/producer_client.cpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * PR feedback --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * Integrate Rust 2 step message receive code to C++ (#6349) * Integrate Rust 2 step message receive code to C++ * If receiving a delivery failed, transmit the error to the message channel if at all possible * Enable Rust based AMQP by default (#6362) * AMQP tests now pass; Integrate TestAmqpBroker with CI pipeline * Updated changelogs to reflect API changes made during AMQP updates * Replace uAMQP with Rust AMQP as the default AMQP transport; Updated build configurationj to reflect that * Test fixes * PR feedback; test fixes * Fixed uninitialized variable tanking some tests (#6381) * Fixed uninitialized variable tanking some tests * Fixed Rust AMQP tests * Removed connection string support from Eventhubs and EH tests. (#6391) * Removed the ability to use connection strings from EventHubs * Enable Rust AMQP by default!!! * Update CMakePresets.json Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| internal | ||
| CMakeLists.txt | ||
| README.md | ||
| test-resources.json | ||
| page_type | languages | products | urlFragment | |||
|---|---|---|---|---|---|---|
| sample |
|
|
azure-core-amqp |
Samples for the Microsoft Azure SDK for C++ AMQP client library
These code samples show common scenario operations for the Azure SDK for C++ AMQP support.
The AMQP client library is a C++ library for communicating with entities that use the AMQP protocol.
These samples are intended to demonstrate common AMQP use scenarios for Azure Service authors and are not intended to be a comprehensive collection of all possible uses for the library. The samples are grouped into folders by feature set. Each sample includes a README that describes the scenario.
Note
AMQP Support in the Azure SDK for C++ is intended only for use with Azure services. It is not a general purpose AMQP library. Because the library is intended for internal consumption only, the contents of this library are NOT subject to the normal breaking change policies for the Azure SDK and may change at any time without warning
Prerequisites
The samples are compatible with C++ 14 and later.
Sample Overview
All samples are standalone console applications that can be built and run independently. Each sample has similar dependencies: They assume that an existing Azure EventHubs instance has been created and the following environment variables are set:
EVENTHUB_CONNECTION_STRING: The connection string for the EventHubs instance.EVENTHUB_NAME: The name of the EventHubs instance.SAMPLES_CLIENT_ID: The client ID for the EventHubs instance.SAMPLES_CLIENT_SECRET: The client secret for the EventHubs instance.SAMPLES_TENANT_ID: The tenant ID for the EventHubs instance.
If you have cloned the azure-sdk-for-cpp repo, this can be done using the Azure SDK Live Test Resource Management tools.
Connect-AzAccount -Subscription 'YOUR SUBSCRIPTION ID'
eng\common\testResources\New-TestResources.ps1 -Location Westus -ServiceDirectory core\azure-core-amqp\samples
This will establish a connection to your Azure account and create a resource group and an EventHubs instance. The connection string and other information will be displayed in the console.
Building and Running the Samples
To build the samples, create a build directory and use CMake to generate the build files. For example:
mkdir build
cd build
cmake ..
Then use CMake to build the samples:
cmake --build .
Each sample is built into its own directory. For example, the eventhub_sas_reader_sample is built into the eventhub_sas_reader_sample directory.
eventhub_sas_reader_sample
Demonstrates reading messages from the Azure Event Hubs service using the AMQP protocol with SAS authentication.
eventhub_sas_writer_sample
Demonstrates writing messages to the Azure Event Hubs service using the AMQP protocol with SAS authentication.
Azure::Core::Amqp::_internal::MessageSenderOptions senderOptions;
senderOptions.Name = "sender-link";
senderOptions.MessageSource = "source";
senderOptions.SettleMode = Azure::Core::Amqp::_internal::SenderSettleMode::Unsettled;
senderOptions.MaxMessageSize = (std::numeric_limits<uint16_t>::max)();
Azure::Core::Amqp::_internal::MessageSender sender(
session, credentials->GetEntityPath(), senderOptions, nullptr);
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;
connectionOptions.ContainerId = "whatever";
connectionOptions.EnableTrace = true;
connectionOptions.Port = credential->GetPort();
Azure::Core::Amqp::_internal::Connection connection(
credential->GetHostName(), credential, connectionOptions);
eventhub_token_reader_sample
Demonstrates reading messages from the Azure Event Hubs service using the AMQP protocol with an Azure bearer token authentication.
eventhub_token_writer_sample
Demonstrates writing messages to the Azure Event Hubs service using the AMQP protocol with an Azure bearer token authentication.
local_client_async_sample
Demonstrates sending messages to a local AMQP server using the AMQP protocol using queued send operations.
local_client_sample
Demonstrates sending messages to a local AMQP server using the AMQP protocol.
local_server_sample
Demonstrates receiving messages from a local AMQP server using the AMQP protocol.
eventhub_get_eventhub_properties_sample
Demonstrates receiving messages from the Azure Event Hubs service using an AMQP Management API.