Bluemix Watson IoT Blockchain multiple invocations in 1 block - ibm-cloud

I'm following this tutorial to connect up Watson IoT with Blockchain.
I set up node-red & Watson IoT Platform with Blockchain extension enabled & connected. I set up the fabric, and everything seems to be working. However, my IoT device sent 3 messages of the same payload thru.
When I look at the block activity, I see 1 block with 3 invocations instead of 3 blocks with 1 invocation each.
Why is there only 1 block versus 3 blocks?

The number of transactions (deploy or invoke) per block depends on timing. Since the IoT device sent three messages with the same payload, I would image that this happened in close time proximity. A block is created every second or when 1,000 transactions have been added to a block (whichever comes first). If the three invocations happened in less than the span of a second, then they would be included in the same block.

Related

Firebase centered architecture

This is an architectural question.
I am currently in the process of designing a web application and I am used to a basic: frontend, api, database, microservices setup.
For the sake of saving money and making my architecture a little bit more modern than what I am used to I decided to look into serverless.
The two main parts I am interested in are google cloud functions and firebase. My understanding is that google cloud functions can be fired when a database entry in firebase has been manipulated.
The way I used to communicate between services was through message queues such as RabbitMQ but it seems to me that by using firebase and cloud functions you can build communication through the database without the need for message queues. What I mean by communication in this case, would be that one service would be able to react to the execution of another service by seeing that an entry in the database was changed.
My question therefore is, what are the upsides and downsides of letting all your "communication" between microservices run through firebase instead of message queues, and is this an architecture that is generally used?
AFAIK, cloud function triggers is a beta feature in Firebase, and according to the doc, there are some limitations for firestore trigger events:
It can take up to 10 seconds for a function to respond to changes in Cloud Firestore.
Ordering is not guaranteed. Rapid changes can trigger function invocations in an unexpected order.
Events are delivered at least once, but a single event may result in multiple function invocations. Avoid depending on exactly-once mechanics, and write idempotent functions.
Cloud Firestore triggers for Cloud Functions is available only for Cloud Firestore in Native mode. It is not available for Cloud Firestore in Datastore mode.
The most concerning limitation here is the first one. 10 seconds for an update is a long time if you need that update to be visible to the user.
Another disadvantage I see is that it may run out of control (in terms of system design) as the complexity increases. You may be tempted to add events for everything, and it may be hard to partition them by category, for example (in message queues, you can use topics for that).
Also, according to the doc, cloud functions are rate-limited to 16 invocations per 100 seconds, which may quickly be reached if you got some traffic on your app.
I would use trigger-events for isolated scenarios and use a message queue for the backbone communication between microservices.

Orion Context Broker Performance Testing

I've been doing some performance testing on Orion Context Broker sending many POST requests to update an attribute inside an entitiy and then check that the subscriptors receive the message correctly. The environment that I built is shown in the next image Environment
To deploy all the components in my server I'm using docker and they comunicate to each other as in an internal network(docker network). A sensor is simulated with a script that send data to Orion. If I want to send 800 post requests per minute, I send a request each 0.075s(60/800).
With the default configuration of Orion(using the docker image from https://hub.docker.com/r/fiware/orion/) when the number of request is around 800, Orion fails and then I receive an "Empty reply from server". I understand that this happens because the default mode for notifications is trasient and this is not suitable for high load scenarios.
I've tried changing the default parameters building another orion image using threadpool mode and test diferent numbers for n(number of workers) and q(queue limit), for example n=8 and q=80, and changed the reqPoolSize to 8(I am working on a machine with 8 cores and 8GB RAM). But now, with around 500 alerts Orion hungs for a few minutes and then works well. I checked the other components in the environment and they seem to be working right. Are there another parameter that I should be looking at, or shoud I keep testing more numbers for the ones that I'm using?

Watson IOT Out node on Raspberry Pi repeatedly disconnecting

I am using a Watson IOT Output (wiotp out) in a Node-RED flow on my Raspberry PI and am having issues with the connection repeatedly disconnecting and then re-connecting.
Here is a screenshot of my Credentials Node and one of my IOT Out Node.
The connection is configured so that I can send messages to the cloud and successfully have them trigger a flow in my cloud Node-RED instance.
The problem I'm having is that when I attempt to send a string array as my payload, very items in the array actually make it through before the service disconnects. I am limited to around 3-5 strings at a time, which is frustrating because I am losing 195-197 of the 200 items I am trying to send to the IOT platform.
How can I keep a persistent connection and make sure my entire payload makes it through to the IOT service?
If you're seeing very frequent disconnects, it can often mean that you're inadvertently performing clientId stealing (i.e., two MQTT clients are fighting over the same clientId). You can confirm this by looking at the device connection logs in the device drilldown panel: you'll see evidence of log messages such as "The client ID was reused."
Ben

VOIP Business setup with asterisk

Hi Asterisk and VOIP Expert,
I want to setup a new VOIP business using asterisk. The requirement is as below:
Asterisk Server 1----------|
| My central
Asterisk Server 2----------| ----SIP Call Forward---> [Asterisk Server]--Trunk-->Call route to any Number
| Billing and Charging
Asterisk Server 3----------| +
CRM
can any one guide how to use my central asterisk server from other asterisk server and route to other part of the word. I mean call establish to any phone. For the call establish to out world..what SIP need to use? Or i need to install digisum cards on my central asterisk server or what?
Target is 20,000 Concurrent call. How concurrent call Asterisk 11.4 can handle?
Please cooperate for any information, or any link or diagram.
Usually you want to forward your outside calls to a VoIP provider (using SIP), so them can be routed to any number worldwide.
Take a look at http://www.voip-info.org/wiki/view/VOIP+Service+Providers
Digium cards, as interface cards of any other manufacturer (Sangoma, for example), could be used to connect your asterisk box to a digital or analog interface of a telecom. Which allows you to receive and send calls over.
First way is less expensive, but much unreliable. Second gives you solid business solution, but charges rise significantly when you start making long-distance calls.
You need to setup extension for each of your servers on central server.
After that you have use extension username/secret for trunk settings on other servers.
http://www.voip-info.org/wiki/view/Asterisk+Connect+2+servers
Unfortunately asterisk not able handle 20000 calls. Hi load servers(more then 200 calls) have be setup by experts, if more then 400 call - using other technologies like opensips(ser,kamailio)+rtprpoxy.
About asterisk hiload: fine tuned asterisk can handle 400-700 calls with media
Without media(just setups,media go directly) asterisk can handle 20-30cps on hi-end servers like 3.2Ghz 8-core xeons:
-- upto 4500 calls with ASR 50% and ACD 5minutes or less if ASR/ACD go down)
-- upto 1250 calls with typical ASR 25% and ACD 2 minutes.
-- only 20-30 calls when no success,so such setup can't be considered production worth.
Note, setup without media WILL have issues if both legs not trusted.

First message not arriving over an MSMQ/MassTransit Service Bus

I've got a MassTransit ServiceBus running over MSMQ. It appears that the first message sent over the Bus doesn't arrive, but subsequent messages do?
Is there some initialization that needs performing on the queue or bus before the message is sent?
This depends on a few settings in how much time the system needs to setup before everything will correctly route. If only first message is failing to end up in the right location, then likely the subscription data isn't propagated everywhere yet. http://readthedocs.org/docs/masstransit/en/develop/overview/subscriptions.html
Using Multicast subscriptions, the easiest choice, will require a few seconds after a endpoint has come up and register a subscriber with all other endpoints. If you can control the order of services starting up, then this can often be avoided by started back to front in the flow.
If you are using the subscription service, then that can also take a couple seconds to get data everywhere. It has to go through the subscription service but the subscription is send to everyone on the bus. This is tied to a SQL db, and latency to the db can effect this timing.
Lastly, if you are using static routing, then that should work immediately, because the subscription is setup upon startup.