DAGDA SEARCH | Back to results | Support

mapperofallmaps (Daniel Lau) · GitHub

Source: https://github.com/mapperofallmaps

@mapperofallmaps mapperofallmaps Follow More @mapperofallmaps mapperofallmaps Follow View mapperofallmaps's full-sized avatar

Daniel Lau mapperofallmaps

Follow tracking my own learning into the world of programming.

Achievements

Achievement: Pull Shark

Achievements

Achievement: Pull Shark

Block or report mapperofallmaps

Report abuse

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

Report abuse More 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

Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.

Uh oh!

There was an error while loading. Please reload this page.