brew install apache-activemq
Modify the the activemq.xml located at /usr/local/Cellar/activemq/5.15.8/libexec/conf (general installation location) to have the following xml snippet
This will enable us to access the activemq use the JMXToolBox
const MongoClient = require('mongodb').MongoClient; | |
let s3Client = require('aws-sdk/clients/s3'); | |
//brute force method loading all the data into an array | |
exports.copyData = async (event, context) => { | |
//this is required for node js mongodb connection pooling | |
context.callbackWaitsForEmptyEventLoop = false; | |
{ | |
"trigger": { | |
"schedule": { | |
"interval": "1m" //how frequently you want the alert to run | |
} | |
}, | |
"input": { | |
"search": { | |
"request": { | |
"search_type": "query_then_fetch", |
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<appender class="ch.qos.logback.core.ConsoleAppender" name="stdout"> | |
<encoder> | |
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [appName:%thread:%X{X-B3-TraceId}:%X{X-B3-SpanId}] %logger{40} - %msg%n | |
</pattern> | |
</encoder> | |
</appender> | |
<appender class="ch.qos.logback.core.ConsoleAppender" name="jsonstdout"> | |
<encoder class="net.logstash.logback.encoder.LogstashEncoder"> |
#inspects what is present in the truststore | |
keytool -list -v -keystore <truststorefile> | |
#gets certificate of a host via command line | |
openssl s_client -connect <host>:<port> | tee <cert-contents> | |
#import certificate into trust store | |
keytool -import -alias <alias> -file <cert-to-import> -storetype JKS -keystore <truststorefile> |
//function to print CSV from an array for robomongo | |
//place this in .robomongorc.js which should be present in your home directory | |
//inspired by https://github.com/Studio3T/robomongo/wiki/How-to-export-to-CSV | |
function toCSV(array) { | |
let deliminator = ','; | |
let textQualifier = '\"'; | |
let headers = []; | |
var data = {}; | |
var count = -1; |
#set($inputRoot = $input.path('$')) | |
#set($tokens = $inputRoot.split('&')) | |
client_secret=SECRET&$tokens[0]&$tokens[1]&$tokens[2]&$tokens[3] |
//given a set of documents | |
var db = [ | |
{ | |
"store": { | |
"storeId": "1", | |
"storeName: "A" | |
}, | |
"audit": { | |
"createdBy": "ME" | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.