title |
---|
Elements of Messaging and Eventing Platforms |
This document provides a brief overview of the essential elements of a messaging and eventing platform and how they relate to each other.
import org.slf4j.LoggerFactory | |
import org.springframework.jdbc.core.JdbcTemplate | |
import org.springframework.stereotype.Component | |
import org.springframework.transaction.annotation.Propagation | |
import org.springframework.transaction.annotation.Transactional | |
import java.time.Duration | |
interface LockManager { | |
fun <T> tryWithLock(key: Long, timeout: Duration, function: () -> T): T | |
} |
#!/usr/bin/env sh | |
# | |
# Simple script that prints out the top N most-used words in a text from standard input. | |
# | |
# Inspired by https://buttondown.email/hillelwayne/archive/donald-knuth-was-framed/. The short | |
# linux script is first shown at https://www.cs.tufts.edu/~nr/cs257/archive/don-knuth/pearls-2.pdf | |
topw() { | |
tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed "$N"q | |
} |
This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.
Keep it simple, stupid. You ain't gonna need it.
-- Let's say you have a table full of work: | |
CREATE TABLE tasks ( | |
id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), | |
status TEXT NOT NULL DEFAULT 'pending', | |
payload JSON NOT NULL, -- or just have meaningful columns! | |
created_at TIMESTAMP NOT NULL DEFAULT NOW() | |
); |
#!/bin/bash -eu | |
if [ -z "${LIB_ROBUST_BASH_SH:-}" ]; then | |
LIB_ROBUST_BASH_SH=included | |
function error { | |
echo "Error: ${1:-}" | |
} | |
# Check to see that we have a required binary on the path | |
function require_binary { |
package com.vlkan.demo.spring; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import javax.annotation.PostConstruct; |
public class HowToUseIt { | |
/** | |
* Usually we'll have a single instance per client | |
*/ | |
private static final SingleThreadPool THREAD_POOL = new SingleThreadPool(); | |
public void executeAsync() { | |
try { | |