https://github.com/cloudamqp/presentation-demo
https://github.com/cloudamqp/presentation-demo
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cloudamqp/presentation-demo
- Owner: cloudamqp
- Created: 2023-09-07T07:11:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-11T08:05:00.000Z (over 1 year ago)
- Last Synced: 2024-12-17T17:40:55.331Z (over 1 year ago)
- Language: Crystal
- Size: 12.7 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# presentation-demo
## Install Crystal
In order to run these applications, you need to install the programming language Crystal. Please follow the instructions on the [official website](https://crystal-lang.org/install/)
#### For [Linux](https://crystal-lang.org/install/#:~:text=Source-,Linux,-Many%20Linux%20distribution)
#### For [Macos](https://crystal-lang.org/install/#:~:text=installing%20on%20Linux-,MacOS,-The%20Crystal%20project)
#### For [Windows](https://crystal-lang.org/install/#:~:text=installing%20on%20MacOS-,Windows,-(preview))
## Clone this repository
```sh
git clone git@github.com:cloudamqp/presentation-demo.git
cd presentation-demo
```
### Install the required dependencies for your app
`shards update`
`shards install`
## Install LavinMQ
#### From source
Clone the git repository and build the project.
```sh
git clone git@github.com:cloudamqp/lavinmq.git
cd lavinmq
make
sudo make install # optional
```
Now, LavinMQ is ready to be used. You can check the version with:
```sh
lavinmq -v
```
Run LavinMQ with:
`lavinmq -D /var/lib/lavinmq`
#### For MacOS
```sh
brew install lavinmq
brew services list
brew services start lavinmq
```
To stop Lavinmq: `brew services stop lavinmq`
#### For Linux(Ubuntu/Debian)
```sh
curl -fsSL https://packagecloud.io/cloudamqp/lavinmq/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/lavinmq.gpg > /dev/null
. /etc/os-release
echo "deb [signed-by=/usr/share/keyrings/lavinmq.gpg] https://packagecloud.io/cloudamqp/lavinmq/$ID $VERSION_CODENAME main" | sudo tee /etc/apt/sources.list.d/lavinmq.list
sudo apt-get update
sudo apt-get install lavinmq
```
Run LavinMQ with:
`lavinmq -D /var/lib/lavinmq`
### Start LavinMQ
Run LavinMQ with:
`lavinmq -D /var/lib/lavinmq`
## Start app
Start the consumer in one terminal window:
`crystal run hello_world_consumer.cr`
Start the publisher in another terminal window:
`crystal run hello_world_publisher.cr`
## Open LavinMQ management UI
### Local LavinMQ
URL: http://localhost:15672/ \
Username: `guest` \
Password: `guest`
### LavinMQ running on CloudAMQP
URL: https://test-freezing-barnacle.lmq.cloudamqp.com/ \
Username: `tjejerkodar` \
Password: `84codes`
## Nice to have
### AMQP client libraries
Client for Crystal used in code along: https://github.com/cloudamqp/amqp-client.cr \
More code examples: https://www.cloudamqp.com/docs/crystal.html
Clients for other languages and code examples: https://www.cloudamqp.com/docs/ruby.html#:~:text=HTTP-,CODE%20SAMPLE,-Ruby