mkdir fubar
cd fubar
npm init .
# Don't forget to specify the test command like 'exit 0'
npm install --save elasticio-sailor-nodejs
npm install --save fibonacci-fast
# Copy files above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"properties": { | |
"customer_id": { | |
"type": "number", | |
"required": false, | |
"title": "Customer id" | |
}, | |
"created_at": { | |
"type": "string", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please note only Node.js code is supported here | |
console.log('We have a message query=%j and body=%j', msg.query || {}, msg.body || {}); | |
if (msg.query && msg.body) { | |
msg.body.__query = msg.query; | |
} | |
// Emit the data event | |
emitter.emit('data', msg); | |
// No need to emit end | |
console.log('Finished execution'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST https://apixpc.magicsoftware.com/v2/flows \ | |
-u renat+magicsoftware@elastic.io:4fc886b7-fef3-4c1e-a3c1-2f679e278583 \ | |
-H 'Accept: application/json' \ | |
-H 'Content-Type: application/json' -d $' | |
{ | |
"data": { | |
"attributes": { | |
"name": "Copy of Performance Test", | |
"cron": null, | |
"default_mapper_type": "jsonata", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"fullName": "Contact", | |
"actionOverrides": [ | |
{ | |
"actionName": "AddCampaign", | |
"type": "Default" | |
}, | |
{ | |
"actionName": "AddToCampaign", | |
"type": "Default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.acme.comp.actions; | |
public class CreateCustomerAction extends Component { | |
@Override | |
public final void execute(ExecutionParameters parameters) { | |
logger.info("About to execute create customer action"); | |
// This is an incoming message | |
final Message message = parameters.getMessage(); | |
// This is outgoing result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.milyn.edisax; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStreamWriter; | |
import java.io.Writer; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* run() { | |
console.log('Incoming attachments=%j', Object.keys(msg.attachments || {})); | |
for(let name in msg.attachments) { | |
let attachment = msg.attachments[name]; | |
console.log('Handling attachment with name=%s url=%s', name, attachment.url); | |
var result = yield request.get({uri : attachment.url}); | |
console.log('Content of the attachment is %j', result.body); | |
}; | |
return {}; | |
} |
tl;dr This blog post describes the best way to host private Docker Registry instance on Amazon EC2 and Amazon S3. You can skip the lyrics and go to the 'Resources' section to get the ECS Task Definition JSON.
When working with microservices nowadays you can hardly avoid using Docker. After building your first Docker container your next step woudl be to share it with the world (or your colleauge). To achieve it you have three alternatives:
- Use a Docker Hub or any other SaaS registry.
- Deploy your own instance of open source Docker Registry project (now called 'Distribution').
- Buy an enterprise version of the Docker registry which is based on open source docker registry project with some addons from Docker Inc.
For a small project the Docker Hub 'way' is the best alternative, you can host one 'private' image for free, where commercial pricing plans will allow you to upload more. For a more serious projects we would like to re
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Q = require('q'); | |
var elasticio = require('elasticio-node'); | |
var messages = elasticio.messages; | |
var soap = require('soap'); | |
exports.process = processTrigger; | |
function processTrigger(msg, cfg) { | |
var self = this; | |
var username = cfg.username; |