Skip to content

Latest commit

 

History

History
 
 

vertx-websocket-chat

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Vertx-Websocket Chat: A Camel Quarkus example

{cq-description}

Tip
Check the Camel Quarkus User guide for prerequisites and other general information.

Start in the Development mode

You can run your application in dev mode that enables live coding using:

$ mvn compile quarkus:dev

The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your workspace. Any modifications in your project will automatically take effect in the running application.You can find the application running http://localhost:8080

Tip
Please refer to the Development mode section of Camel Quarkus User guide for more details.

As we run the example in Quarkus Dev Mode, you can connect to the websocket by providing a username.Once you connect, you can see a chat room where you can send/receive messages. You can write your message in the message section and you will be able to send the message either to a specific peer or to all of the users conncected by clicking the dropdown of the send button.You can click on the peer of your choice from the list to send the message only to that speicific peer.On clicking Send All,you can send your message to all of the users connected locally.You’ll also be able to see the conversation on your window.

Package and run the application

Once you are done with developing you may want to package and run the application.

Tip
Find more details about the JVM mode and Native mode in the Package and run section of Camel Quarkus User guide

JVM mode

$ mvn clean package
$ java -jar target/quarkus-app/quarkus-run.jar

Native mode

Important
Native mode requires having GraalVM and other tools installed. Please check the Prerequisites section of Camel Quarkus User guide.

To prepare a native executable using GraalVM, run the following command:

$ mvn clean package -Pnative
$ ./target/*-runner

Feedback

Please report bugs and propose improvements via GitHub issues of Camel Quarkus project.