Kafka Topic A, Partition 3 --> Service Instance 2 --> internal Kafka topic +---> Service Instance 1 --> Event stream listener /customer1
`--> Service Instance 2
+----------------------------+
| Kafka Topic A, Partition 1 +------. +--------------+ +-----------+
+----------------------------+ `-->+ Service | | |
| Instance 1 +<---------------+ | | API HTTP request
+----------------------------+ ,-->+ | | | +<----- Event stream listener
| Kafka Topic A, Partition 2 +------` +--------------+ | | API | /customer1
+----------------------------+ +----+ Gateway |
+--------------+ | |
+----------------------------+ | Service |DataUp
This file contains hidden or 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
# AWS specific install of Docker | |
sudo yum update -y | |
sudo yum install -y docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
# exit the SSH session, login again | |
# Docker | |
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq |
This file contains hidden or 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
/** | |
* Custom emitter. | |
*/ | |
@GetMapping(value = "/custom-emitter", produces = MediaType.TEXT_EVENT_STREAM_VALUE) | |
public Flux<String> getCustomEmitter() { | |
EmitterProcessor<String> hotSource = EmitterProcessor.create(); | |
Flux<String> hotFlux = hotSource.publish().autoConnect(); |
This file contains hidden or 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
-- MIGRATION1: (copy data) | |
-- create new table | |
CREATE TABLE cdm.adresses ( | |
id BIGINT(20) AUTO_INCREMENT PRIMARY KEY, | |
enrichment_erp_id BIGINT(20) UNIQUE NOT NULL, | |
latitude DECIMAL(20,6) NOT NULL, | |
longitude DECIMAL(20,6) NOT NULL, | |
zip_code VARCHAR(20) NOT NULL, | |
street VARCHAR(255), |
This file contains hidden or 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
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array | |
This file contains hidden or 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
//login as admin using the db where the admin user is defined | |
mongo --port 27017 -u "admin" -p "admin" --authenticationDatabase "admin" | |
// or the default: | |
mongo --port 27017 -u "root" -p "password" --authenticationDatabase "root" | |
//list all system users: | |
db.system.users.find() | |
This file contains hidden or 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 fs = require('fs'); | |
var content = readFile("19_3_2018log.txt"); | |
var allLines = getLines(content); | |
console.log("All lines:"); | |
console.log(allLines); | |
var result = allLines.map(line => parseLineToObject(line)); | |
console.log("Result:"); | |
console.log(result); |
This file contains hidden or 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
# add remote repo from another filepath: | |
git remote add -f springBootSippetsFullRepo ../1/spring-boot-snippets-full-folder | |
# merge to current master (will not messup original files) | |
git merge -s ours springBootSippetsFullRepo/master | |
# move new repo in a subfolder: | |
git read-tree --prefix=springBootSnippets -u springBootSippetsFull/master | |
# comit new folder: |