Debian Codegraph @

src/vendor/azure-uamqp-c/readme.md

raw
1 This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
2
3 # uAMQP
4
5 `uAMQP` is a C library for AMQP 1.0 communication to Azure Cloud Services.
6
7 The goals are:
8
9 - Compliance with the standard
10 - Optimizing for low RAM footprint
11 - Be as portable as possible
12
13 It is currently a client side implementation only.
14
15 ## Dependencies
16
17 `uAMQP` uses `azure-c-shared-utility`, which is a C library providing common functionality for basic tasks (string manipulation, list manipulation, IO, etc.).
18 `azure-c-shared-utility` is available here: https://github.com/Azure/azure-c-shared-utility and it is used as a submodule.
19
20 Please note that azure-c-shared-utility in turn depends on several libraries (libssl-dev, libuuid-dev, libcurl-dev).
21
22 On an Ubuntu distro it is recommended to install all needed packages by running:
23
24 ```
25 sudo apt-get update
26 sudo apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev
27 ```
28
29 azure-c-shared-utility provides several tlsio implementations, some being:
30 - tlsio_schannel - runs only on Windows
31 - tlsio_openssl - depends on OpenSSL being installed
32 - tlsio_wolfssl - depends on WolfSSL being installed
33 - tlsio_mbedtls
34 - ...
35
36 For more information about configuring `azure-c-shared-utility` see https://github.com/Azure/azure-c-shared-utility.
37
38 `uAMQP` uses cmake for configuring build files.
39
40 For WebSockets support `uAMQP` depends on the support provided by azure-c-shared-utility.
41
42 ## Setup
43
44 ### Build
45
46 - Clone `azure-uamqp-c` by:
47
48 ```
49 git clone --recursive https://github.com/Azure/azure-uamqp-c.git
50 ```
51
52 - Create a folder named `cmake` under `azure-uamqp-c`
53
54 - Switch to the `cmake` folder and run
55
56 ```
57 cmake ..
58 ```
59
60 - Build
61
62 ```
63 cmake --build .
64 ```
65
66 ### Installation and Use
67
68 Optionally, you may choose to install azure-uamqp-c on your machine:
69
70 1. Switch to the `cmake` folder and run
71 ```
72 cmake -Duse_installed=ON ../
73 ```
74 ```
75 cmake --build . --target install
76 ```
77
78 or install using the follow commands for each platform:
79
80 On Linux:
81 ```
82 sudo make install
83 ```
84
85 On Windows:
86 ```
87 msbuild /m INSTALL.vcxproj
88 ```
89
90 2. Use it in your project (if installed)
91 ```
92 find_package(uamqp REQUIRED CONFIG)
93 target_link_library(yourlib uamqp)
94 ```
95
96 _This requires that azure-c-shared-utility is installed (through CMake) on your machine._
97
98 _If running tests, this requires that umock-c, azure-ctest, and azure-c-testrunnerswitcher are installed (through CMake) on your machine._
99
100 ### Building the tests
101
102 In order to build the unit tests use:
103
104 ```
105 cmake .. -Drun_unittests:bool=ON
106 ```
107
108 In order to build the end to end tests use:
109
110 ```
111 cmake .. -Drun_e2e_tests:bool=ON
112 ```
113
114 Please note that some end to end tests (talking to Event Hubs or IoT Hubs) require setup of environment variables so that the tests have the information about the endpoints that they need to connect to.
115
116 ## Switching branches
117
118 After any switch of branches (git checkout for example), one should also update the submodule references by:
119
120 ```
121 git submodule update --init --recursive
122 ```
123
124 ## Samples
125
126 Samples are available in the azure-uamqp-c/samples folder:
127
128 - Send messages to an Event Hub
129 - Receive messages from an Event Hub
130 - Send messages to an IoT Hub using CBS
131 - Send messages to an IoT Hub using AMQP over WebSockets
132 - Simple client/server sample using raw TCP