Nifi Error: Failed to establish the connection with AMQP broker - hadoop

I am trying to read the data from following cap files.
everyhing from alerts folder
http://dd2.weather.gc.ca/alerts/cap/20180205/CWHX/14/
I am using AMQP from http://metpx.sourceforge.net. And when I am trying to connect to subscriber from nifi, I am getting the following error.
Failed to establish the connection with AMQP broker
this is my cap.conf file.
broker amqp://anonymous:anonymous#dd.weather.gc.ca
directory /data
subtopic alerts.cap.#
accept .*
mirror True

Over the summer, the broker migrated to SSL, so the current URL would be: amqps://anonymous:anonymous#dd.weather.gc.ca
The web page has also moved to: https://github.com/MetPX/sarracenia
best practice to put authentication info in ~/.config/sarra/credentials.conf
a line like: amqps://anonymous:anonymous#dd.weather.gc.ca
Installing a version from the past year is likely to be a much
better experience. It now comes with sample configurations,
one of them being ddc_cap-xml.conf which is the same data you
are trying to download.
So the work is:
blacklab% sr_subscribe add ddc_cap-xml.conf
blacklab% sr_subscribe edit ddc_cap-xml.conf
# Change the directory option to suit your case.
blacklab% sr_subscribe foreground ddc_cap-xml.conf
And it should work. It could take many hours to prove it because this particular set (severe weather warnings in Common Alerting Protocol format) is produced only when needed, rather than continuously. (Use start instead of foreground to run as a background daemon.)
To test things, it might be easier to start with dd_swob, which will be a continuous feed.
blacklab% sr_subscribe list dd_swob
broker amqp://anonymous#dd.weather.gc.ca
exchange xpublic
#msg_skip_threshold 60
#on_msg ../msg_skip_old.py
subtopic observations.swob-ml.#
accept .*
In this configuration you need to add a directory option just before the accept line. and should start downloading data immediately. Once you know it works, switch back to the data set you actually want.

Related

I have a problem on sending Downstream to a gateway

I'm using a dragino DLOS8 gateway and a dragino end node lt-22222-l. I wrote a script to read and show the values in my end node's inputs but I couldn't control my relays. I found an example of a script (in a dragino article titled Communication with ABP End Node) showing this function to control them( it controlled the digital outputs but I changed it to relays) which is:
echo "${DEV_2},imme,hex,030101" > /var/iot/push/down
I even tried with more specified one:
echo "${DEV_1},imme,hex,030101,20,1,SF12,869525000,1" > /var/iot/push/down
in the article it indicates that I have to create a file in the directory /var/iot/push for downstream purpose. I tried using winscp and the command touch down but it deleted few seconds after. if there is anyone that used those devices or knows about this please help me.
I had a similar problem with Dragino, also with device logfiles in /var/iot/channels directory. Got information from Dragino support that those files are "consumed" by MQTT and TCP processes, so are periodically deleted: I undestand that LoRaWAN or MQTT or TCP application has to work with those files as soon as they are generated.
Notice that "imme" sends downstream immediately to C type devices, maybe "time" (downstream after receiving data from node) is better for your application.

Create new file transfer configuration using IBM MQMFT

I am using IBM MQMFT hosted on-premise and I have a request to transfer a new file from one server to the other.
Both servers already have MQ agents and are already sending some files across.
I would like to be able to add this new file configuration so that the file can also be picked up.
Please advise the steps required to achieve this. Do I just edit the agent's XML?
If you simply wish to send a file from one agent to another, and those agents are already configured...
Use the fteCreateTransfer command for a 'one off':
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/start_new_transfer_cmd.htm
Consider a resource monitor (via fteCreateMonitor) or scheduled transfer (via fteCreateTransfer) if you're doing it on a regular basis:
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/create_monitor_cmd.htm

Failover when reading from FTP sites using Camel

We need to download multiple files on a hourly basis from a vendors FTP site. The vendor provides two ftp sites for fault tolerance with both sites having identical files. I would like to setup a Camel route to download the files from ftp site A if its available and if not try ftp site B. The following code is incorrect but it may highlight what I am trying to achieve.
from("timer://timer1?fixedRate=true&period=60m")
.loadBalance()
.failover(-1, false, true)
.to("direct:ftp-symbolguides-1")
.to("direct:ftp-symbolguides-2")
.end();
from("direct:ftp-symbolguides-1")
.to("ftp://SiteA?localWorkDirectory=c:/temp&passiveMode=true&noop=true&idempotentKey=${file:name}-${file:size}&idempotentRepository=#idempotentRepository")
.to("file:/c:/temp/inbox");
from("direct:ftp-symbolguides-2")
.to("ftp://SiteB?password=publicftp&localWorkDirectory=c:/temp&passiveMode=true&noop=true&idempotentKey=${file:name}-${file:size}&idempotentRepository=#idempotentRepository")
.to("file:/c:/temp/inbox");
Does anyone have any thoughts on how I can achieve this?
When the connection fails by default ftp consumer produces a WARN message instead of throwing an exception, but by the throwExceptionOnConnectionFailed property you can change to throw exception, and handle exception from the
PollingConsumerPollStrategy[1] rollback() method.
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/PollingConsumerPollStrategy.html

Websphere Message broker multi-instance message flow

I am looking for a command to change the message broker message flow instance in the run time. I know it is quite easy with MB explorer. But I am more interested towards the server side mqsi command. Ours is a AIX env with message broker 8 installed.
The number of instances a message flow has on the execution group is configured in the BAR file, before deployment.
If you want to change the number of additional instances you will need to redeploy your flow.
You can use the mqsiapplybaroverride command to change the configuration of the flow in the BAR file, and the mqsideploy command to redeploy the BAR.
As of IIB v9 you can control the number of instances dynamically at runtime by assigning a workload management policy.
See the description here:
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bn34262_.htm
Once you have assigned a policy you can change it using the mqsichangepolicy command specifying an xml policy document that has a different number of instances.
Alternatively you can use the web ui to change it directly on the running broker.

WebSphere MQ FTE Agent Directory does not exist?

When I tried to start an FTE agent in the command prompt , it displays the error message as "An internal error has occurred. Unable to complete the command because the agent directory does not exist".
What would be the reason for this? It was working fine until yesterday. And is there any way to start an agent in MQ FTE itself? I use fteStartAgent in command prompt each time to start an agent.
Kindly advise me on this....
There are a few possible reasons for this. It is possible that the default properties were changed and now point to an invalid location. This usually happens when the different components are installed and you select to provide the connection details again rather than to reuse the existing configuration.
Another possibility is that the default properties have been changed to point to a different Coordination QMgr. Sometimes people want to run Prod and Dev agents on the same host and set up connectivity to more than one Coordination QMgr. The result is that the default properties can point to only one at a time and so some agent directories are found while others are not. The trick to making this work is to use the -P option to select the proper Coordination QMgr.

Resources