![]() ![]() So we define the command message in our config, and since we want this to be fun, we are going to randomly generate what kind of style, move, weapon, and target he will use. In our example, we want to generate a Jackie Chan command message that will be sent to his control unit via Kafka. This can be any kind of json object you want. The Step Config is your specific definition of a json event. The duration specifies how long to run this step. Next, are the Steps that this Workflow defines.So this is like saying we want Jackie Chan to do a martial arts move every 400 milliseconds (he’s FAST!), then take a break for 1.5 seconds, and do another one. At the top are the properties that define how often events should be generated and if / when this workflow should be repeated.The Workflow defines many things that are all defined on the github page, but here is a summary: A Jackie Chan command might look like this: We can command Jackie Chan though a programmable interface that happens to take json as an input via a Kafka queue and you can command him to perform different fighting moves in different martial arts styles. It is the Workflow that defines the format and content of your Events as well.įor our example, we are going to pretend that we have a programmable Jackie Chan robot. The Workflow defines the frequency of Events and Steps that the Workflow uses to generate the Events. The second is a Workflow configuration (of which you can have multiple). The Simulation Config defines the Workflows that should be run and different Producers that events should be sent to. You define the configuration for the json-data-generator using two configuration files. These destinations could be a log file, or something more complicated like a Kafka Queue. You will also need to define Producers that are used to send the Events generated by your Workflows to some destination. The Workflows then generates Events and these Events are then sent somewhere. The Simulation can specify one or many Workflows that will be run as part of your Simulation. The generator runs a Simulation which you get to define. Head there now and download a release to get started! Configuration You can always find the most recent release over on github where you can download the bundle file that contains the runnable application and example configurations. ![]() With that said, we’d like to show to the basics here in this post to give you an idea of how the json-data-generator might help you on your projects. For the full (and updated) documentation, please view the README on the github project page. The json-data-generator has too many different configuration options and features to go over in a blog post like this. We now have a data generator that supports all of these things that can be run on our own networks and produce streams of json data for applications to consume. Generate events in a defined order, at defined or random time periods in order to act like a real system.We might need to send the data to a log file or to a Kafka Queue or something else. Generate a constant stream of json events that are sent somewhere.This includes different types of random data, not just random characters, but things like random names, counters, dates, primitive types, etc. Generate json with random data as values.This would allow us to take existing schemas, drop them in to the generator, modify them a bit and start generating data that looks like what we expect in our application Generate json documents that are defined in json themselves.We had a couple of needs when it came to generating data for testing purposes. You can find the json-data-generator over on github. We found it so useful, that we decided to open source it as well so other can make use of it in their own projects. There are plenty of json data generator online (like json-generator, or mockaroo), but we couldn’t find an offline data generator for us to use in our testing and prototyping, so we decided to build one. Have you ever needed to generate a realtime stream of json data in order to test an application or build a prototype? When thinking about a good source of streaming data, we often look to the Twitter stream as a solution, but that only gets us so far in prototyping scenarios and we often fall short because Twitter data only fits a certain amount of use cases. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |