DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How To Get Cell Data From an Excel Spreadsheet Using APIs in Java
  • 8 Strategies To Accelerate Web Portal Development
  • A Better Web3 Experience: Account Abstraction From Flow (Part 1)
  • How To Create a Restful Web Service Using Low Code Integration Platform

Trending

  • Securing the AI Host: Spring AI MCP Server Communication With API Keys
  • Beyond Manual Annotation: Engineering Self-Correcting Pseudo-Labeling Pipelines
  • Zero-Downtime Deployments for Java Apps on Kubernetes
  • Why Stable RAG Answers Can Still Hide Unstable Evidence

Managing Camel Routes With Kura Web UI

Camel and Kura integrate wonderfully, and we've already explored Camel routes into Kura with Rhiot. Here's a breakdown of managing Camel routes with the Kura web UI.

By 
Henryk Konsek user avatar
Henryk Konsek
·
Dec. 10, 15 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
7.0K Views

Join the DZone community and get the full member experience.

Join For Free

In my previous post about Camel and Kura integration I demonstrated how to easily deploy Camel routes into Kura using Rhiot. In this article I would like to elaborate a little bit on how to manage Camel routes from the level of the Kura web UI.

Loading XML Routes Using SCR Property

RhiotKuraRouter comes with a RhiotKuraRouter#updated(Map) method. The primary purpose of this callback is to allow a router to be a SCR component configured using the Kura Web UI and EuroTech Everyware Cloud, however you can use this callback outside the web UI and Everyware Cloud context.

Whenever RhiotKuraRouter#updated(Map) callback is executed, RhiotKuraRouter tries to read camel.route.xml property value (RhiotKuraConstants.XML_ROUTE_PROPERTY key constant), to parse its value and load it as an XML Camel routes. For example if the camel.route.xml property will be set to the following value...

<routes xmlns="http://camel.apache.org/schema/spring">
    <route id="mqttLogger">
        <from uri="paho:topic?brokerUrl=tcp:brokerhost:1883"/>
        <to uri="log:messages"/>
    </route>
</routes>

...new route will be automatically started (or updated if route with ID equal to mqttLogger already exists).

All the above basically mean that if you register your Kura router as OSGi declarative service, you will be able to dynamically load and update XML routes using OSGi configuration admin service.

Managing XML Camel Routes Using Web UI

All RhiotKuraRouter instances implements Kura's ConfigurableComponent interface. It means that those can be configured using Kura web UI.

I highly recommend to use Rhiot Kura Camel quickstart as a template for creating Kura Camel routers. Our quickstart is configured as SCR component, so you can just deploy it to the Kura server and see your gateway route module deployed as a configurable service. To specify the route XML that should be loaded by a Camel context running in a deployed module, edit the camel.route.xml service property and click Apply button. As soon as Apply button is clicked, the route will be parsed and loaded.

Image title

Our Kura Camel quickstart can be also used from the EuroTech Everyware Cloud (EC).

Image title

Maintenance of the Kura Routes at Runtime

The ability to maintain Camel routes from web UI without restarting a Kura server is extremely important when it comes to the long term maintenance of your IoT gateway solution. It allows to modify a flow of the existing message routes or create new rules without affecting an uptime of your production environment.

Production-level grade IoT gateway (Kura) and powerful messaging framework (Camel) are an example of a perfect combination of two mature technologies which used together result in a solid, but flexible Internet Of Things solution.

Web Service

Opinions expressed by DZone contributors are their own.

Related

  • How To Get Cell Data From an Excel Spreadsheet Using APIs in Java
  • 8 Strategies To Accelerate Web Portal Development
  • A Better Web3 Experience: Account Abstraction From Flow (Part 1)
  • How To Create a Restful Web Service Using Low Code Integration Platform

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook