mapperofallmaps (Daniel Lau) · GitHub
Skip to content
View mapperofallmaps's full-sized avatar
  • Sydney

Block or report mapperofallmaps

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
mapperofallmaps/README.md

Agent Interaction API

Spring Boot REST API for tracking email, phone, and in-person interactions with agents.

Storage

Agents and interactions are held in an in-memory store (ConcurrentHashMap-backed repositories) — state resets on restart. There is no database.

Running

mvn spring-boot:run

The API listens on http://localhost:8080.

REST API

Agents

Method Path Description
POST /api/agents Create an agent
GET /api/agents List all agents
GET /api/agents/{id} Get an agent
PUT /api/agents/{id} Update an agent
DELETE /api/agents/{id} Delete an agent (and its interactions)

Interactions

Method Path Description
POST /api/agents/{agentId}/interactions/email Log an email interaction
POST /api/agents/{agentId}/interactions/phone Log a phone interaction
POST /api/agents/{agentId}/interactions/in-person Log an in-person interaction
GET /api/agents/{agentId}/interactions?type= List an agent's interactions (optional type filter: EMAIL, PHONE, IN_PERSON)
GET /api/interactions/{id} Get a single interaction
DELETE /api/interactions/{id} Delete an interaction

Kafka listeners

Two consumers keep the in-memory store in sync with an upstream system of record:

Topic Message Config key
agent-updates com.mapperofallmaps.agentinteractions.messaging.AgentEventMessage app.kafka.topics.agent-updates
interaction-updates com.mapperofallmaps.agentinteractions.messaging.InteractionEventMessage app.kafka.topics.interaction-updates

Each message carries an eventType of CREATED, UPDATED, or DELETED plus the full record; the listener upserts or deletes the matching entry in the in-memory store. Broker location is set via spring.kafka.bootstrap-servers (env var KAFKA_BOOTSTRAP_SERVERS, defaults to localhost:9092).

Example agent event payload:

{
  "eventType": "UPDATED",
  "id": 42,
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "phoneNumber": "555-0100"
}

Popular repositories Loading

  1. project-based-learning project-based-learning Public

    Forked from practical-tutorials/project-based-learning

    Curated list of project-based tutorials

  2. JavaLearning JavaLearning Public

    Java

  3. C-projects C-projects Public

    C

  4. PythonProjects PythonProjects Public

    Python

  5. mapperofallmaps mapperofallmaps Public

    Config files for my GitHub profile.

    Java