Fiware MQTT IoT Agent: need to have slashes in the API Key - mqtt

We have are using the Fiware MQTT Iot Agent. We understand that the topic should be in the format /api_key/device_id/attrs when publishing data from the device.
But we have a requirement where our topic is a long string with multiple slashes in it. But Fiware currently is not supporting any additional slashes(/) in api_key.
Can you please let us know if there is a way to overcome this issue. Thanks for your support!

You won't be able to use a Standard IoT Agent for that, you will need to create your own custom IoT Agent.
The definition of the MQTT Topics to subscribe to can be found within MQTTBinding.js
The reading of incoming messages can be found in commonBindings.js
To alter the path you will need to follow the instructions found in 205 - Custom IoT Agent
clone the base repository
branch from the latest release.
Amend MQTTBinding.js and commonBindings.js to listen to your preferred location
Create your own Dockerfile which uses the COPY instruction
Obviously same applies if using the JSON IoT Agent.

Related

Is there any way to integrate Zabbix with Webhook?

I want to get Openshift(OCP) alerts on Zabbix. OCP supports Webhook integration to send data. Is there any way to send data to Zabbix via Webhook?
Thanks
No (as of Zabbix 5), you need to build your own webhook-to-zabbix connector, but it's fairly simple, using the already existing libraries available for most languages. Example: https://github.com/gmauleon/alertmanager-zabbix-webhook

How to create a REST API such as arest.io using Mosquitto

I would like to create cloud service like arest.io to access MQTT broker (Mosquitto) via REST API like it is on cloud.arest.io service. The main goal is bridge between mosquitto mqtt broker and apache2 http server to getting access to sepecific mqtt topics like:
cloud.arest.io/47fd9g/digital/5/1
where 47fd9g/digital/5/1 means publish "digital/5/1" in "47fd9g" topic. In the http response I can get JSON data from my IoT device connected to "47fd9g" topic. If you ever used the arest arduino library and arest.io cloud, You know what I mean. I have ubuntu based server with apache, php, mosquitto, php, Mosquitto-PHP php extension. Mosquitto works fine with my IoT device but I don't know how to mosquitto and apache make working toghether like arest.io.
There are a number PHP MQTT clients that you can use to write service as you describe, but you don't directly connect apache to mosquitto. You will have to write the bridge.
But encoding data into the URL as you suggest is not going to work well, it assumes that topics are only ever a single level deep which really doesn't scale well and doesn't allow the use of wildcards.
It would be better to have a HTTP POST to http://example.com/some/multi/level/topic, with the message payload as the body of the post would publish to a the topic some/multi/level/topic makes a lot more sense.

Failure reason: "Host not found" Received status code: "502" - Creating a destination in SAP cockpit

I am new to SAP and development of SAP Fiori Application. I want to create a project consuming oData service.
I have created a SAP cloud platform Cockpit trial account and created a destination for my in house development gateway.
When I click on test connection, it shows host not found: 502.
I am not able to access oData connection url without saml2=disabled parameter, so tried with Basic authentication using my SAP user.
SAP is on Azure cloud. What am I missing here?
Based on your hardware landscape you might need to configure SAP Cloud Connector,
as documented here:
“The Cloud Connector serves as a link between SAP Cloud Platform applications and on-premise systems. It combines an easy setup with a clear configuration of the systems that are exposed to the SAP Cloud Platform. You can also control the resources available for the cloud applications in those systems. Thus, you can benefit from your existing assets without exposing the whole internal landscape.
The Cloud Connector runs as on-premise agent in a secured network and acts as a reverse invoke proxy between the on-premise network and SAP Cloud Platform. Due to its reverse invoke support, you don't need to configure the on-premise firewall to allow external access from the cloud to internal systems.”
And also look here:
“If your remote system resides behind a firewall (proxy type OnPremise), the following prerequisites must be met:
You have set up Cloud Connector and defined a virtual host mapping for the system.”
Also take a look here:
“Maintain Destinations for SAP Cloud Platform Connector
In the SAP Cloud Platform Cockpit, maintain destinations for each target system to enable communication via the SAP Cloud Platform Connector.
For on premise systems, make sure to select the Proxy Type OnPremise.”
I also faced a similar issue yesterday night. This generally has to do with some config problems.
For me, it was the Proxy settings. it was set to 'Internet'.
It had to be set to 'OnPremise'. After doing that, it got successfully connected.

Can a web browser use MQTT?

We are looking at using MQTT as the messaging protocol on a new device we're building. We'd also like a web interface for the device. Does anyone know if you can implement a browser client app (without additional plugins) that talks MQTT?
Yes, as mentioned in Steve-o's comment MQTT via websockets is very possible.
There are 2 options at the moment
IBM's MQ 7.5 comes with websockets support, you can find details here.
The Mosquitto broker has a javascript client with an example running here.
To answer your second question lighttpd has a websockets module that can be used to do forwarding to an existing broker with details here.
I've not been able to find anything for Apache that doesn't need you to write your own library to do the forwarding.
To extend hardillbs answer:
There is a third option now:
HiveMQ supports native websockets without the need for any external web server. It works perfectly with the Javascript client of Eclipse Paho.
If you want to try it out, the public MQTTDashboard (which uses HiveMQ under the hoods) supports websockets on port 8000.
Disclosure: I am one of the developers of HiveMQ
IBM has released a WebSockets based JavaScript client. It is open-source on Eclipse Paho.
Git repository:
http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.javascript.git/
Tutorial is here.
https://www.ibm.com/developerworks/community/blogs/c565c720-fe84-4f63-873f-607d87787327/entry/how_to_prog_javascript?lang=en
We've had good experience using WSS, the WebSocket to TCP Gateway (for MQTT). It means running a separate process, but that does avoid having to change Apache's configuration. WSS also has support for TLS.
Not Apache, but you can follow this guide to install lighttpd with mod_websocket,
http://oriolrius.cat/blog/2013/09/25/server-send-push-notifications-to-client-browser-without-polling/
but for easy of use I highly recommend HiveMQ, as #Dominik recommends.
The blog by jpmens is a good starting point to get mosquitto setup with websocket feature. He's client javascript code based on Paho is on github.
This blog "How to run your web server and MQTT WebSockets broker on the same por" explains two ways for the server side:
mosquitto with http configuration
apache+mod_websocket_mosquitto
Why not nodejs + socket.io? They come with all gadgets included (webscokets, pub/sub, webserver,mqtt broker...).
SocketCluster is another good starting point.
This link (Download codes) is useful. Download it and modify this file mosq-mqttws31.html. Instead of the embedded java script library use this cdn
https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.js
and the client instantiation should be client = new Paho.MQTT.Client("test.mosquitto.org", 8080,"myclien256tiddd_" + parseInt(Math.random() * 100, 10));

Can Fuse ESB implement message broker and message queue

I'm a really newbie in ESB (you can say no experience).
And actually I haven't really understood the real meaning of ESB.
My expectation of ESB is a middleware that can connect to whatever the client is
(.NET, Flex, Ajax, Android, etc.).
And I expect that ESB can implement MESSAGE QUEUE.
Cause I'm really really interested in message queue.
I just tried Mule ESB.
I successfully created SOA request-response.
But it seems that Mule ESB doesn't have message queue.
AND MY QUESTION IS:
Is it possible for Fuse ESB to implement message queue?
Thank you,
Rizki Sunaryo
Yes Fuse ESB has a message broker embedded (its Apache ActiveMQ). So you have that out of the box with Fuse ESB.
You can also with Fuse ESB connect to an external message broker of choice, using JMS as the protocol. For example to connect to a WebSphereMQ, WebLogicAQ, etc.
There is also a standalone Fuse MQ product that is just the message broker. So if you only want a messaging system, then you can go for Fuse MQ.
You can find some details here
http://fusesource.com/products/fuse-esb-enterprise/
http://fusesource.com/products/fuse-mq-enterprise/
Red Hat has since acquired FuseSource so the Fuse products is being rebranded as JBoss Fuse, and JBoss A-MQ. You can find details here:
http://www.redhat.com/products/jbossenterprisemiddleware/fuse
http://www.redhat.com/products/jbossenterprisemiddleware/amq/

Resources