Skip to content

Instantly share code, notes, and snippets.

version: "3.9"
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
restart: always
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.8.2</version>
<executions>
<execution>
<id>schemas</id>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
{
"type": "record",
"namespace": "com.example.restaurant.avro.schema",
"name": "OrderAvro",
"fields": [
{
"name": "eventType",
"type": "string",
"default": "ORDER_CREATED"
},
import com.example.restaurant.avro.schema.OrderAvro;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.SendResult;
import org.springframework.stereotype.Service;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.util.concurrent.ListenableFutureCallback;
import com.example.restaurant.avro.schema.OrderAvro;
import com.example.restaurant.mapper.OrderMapper;
import com.example.restaurant.models.EventTypes;
import com.example.restaurant.models.OrderModel;
import com.example.restaurant.serviceimpl.OrderServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
import com.example.restaurant.avro.schema.OrderAvro;
import com.example.restaurant.kafka.AvroProducer;
import com.example.restaurant.mapper.OrderMapper;
import com.example.restaurant.models.EventTypes;
import com.example.restaurant.models.OrderModel;
import com.example.restaurant.models.OrderStatus;
import com.example.restaurant.repository.OrderRepo;
import com.example.restaurant.request.OrderRequest;
import com.example.restaurant.service.OrderService;
public enum EventTypes {
ORDER_CREATED,
ORDER_SERVING,
ORDER_CANCELLED,
ORDER_SERVED,
ORDER_UPDATED,
ORDER_DELETED
}
@lamoboos223
lamoboos223 / ubuntu-install-bitchx.sh
Created July 16, 2022 23:51 — forked from AubreyHewes/ubuntu-install-bitchx.sh
Compile and Install BitchX on Ubuntu
#!/bin/sh
####################################################################################
#
# Download Compile and Install BitchX on Ubuntu
#
####################################################################################
# download bitchx source
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
package com.example.demohaproxy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]