Skip to content

BOOST.APIGateway

An HTTP-to-JMS translation gateway that exposes REST APIs for frontend clients, translates requests into JMS messages, routes them to backend compute queues, and returns responses. Built with Jersey (JAX-RS) on Jetty.

Note: This project currently lives at C:\eclipse-workspace\PortalAPI.

Architecture

HTTP Client

Jetty HTTP Server (:8080)

BOOSTAuthFilter (JWT validation)

Jersey Router

┌─────────────────┬────────────────────────┐
│ Static Endpoints│ Dynamic Endpoints       │
│ (PortalServiceV3│ (DynamicRequestInflector│
│  MinioServiceV1)│  loaded from MySQL)     │
└────────┬────────┴───────────┬────────────┘
         ↓                    ↓
    ActiveMQService.send()

    JMS Message → AMQP Broker

    Wait for Reply on Temp Queue

    HTTP Response ← JMS Response

HTTP → JMS Translation

Every HTTP request is translated into a JMS message:

json
{
  "auth": "<bearer_token>",
  "method": "<operation_name>",
  "body": { /* request data */ }
}

The gateway waits for a response on a temporary reply queue, then converts it back to an HTTP response with the appropriate status code.

Prerequisites

  • Java 21
  • AMQP Broker (ActiveMQ / RabbitMQ)
  • MySQL (for dynamic endpoint definitions)
  • Redis (caching, auth decisions)
  • MinIO (S3-compatible file storage)

Configuration

config.properties

properties
redis_uri=redis://172.16.200.65:6379
redis_database_index=10

Hardcoded Connections

ServiceURI
AMQP Brokeramqp://172.16.200.32:5672
MySQLjdbc:mysql://172.16.200.45:3306/boost_apifrontend
MinIOhttps://s3.se-01.westbahr.net

JMS Queues

QueuePurpose
boostv3.stageapi.messagesPrimary API requests
boostv3.loggingLogging messages
nimpos.api.messagesNimpos-specific requests

Authentication

  • Bearer Token: JWT validated by BOOSTAuthFilter
  • Claims extracted: tenant_id, user_id, exp
  • Tokens are passed through to backend services for authorization

REST Endpoints

Authentication

MethodPathDescription
POST/BOOST/v3/authorizeUser login
POST/BOOST/v3/tokenGenerate token
GET/BOOST/v3/whoamiCurrent user info

Customers & Organizations

MethodPathDescription
GET/BOOST/v3/customersList customers
GET/BOOST/v3/organizations2Find organizations
POST/BOOST/v3/organizations2Create organization
GET/PUT/DELETE/BOOST/v3/organizations2/{id}CRUD by ID

Articles & Inventory

MethodPathDescription
GET/BOOST/v3/articlesFind articles
GET/BOOST/v3/articles/{id}Get by ID
GET/BOOST/v3/articles/sku/{sku}Get by SKU
GET/BOOST/v3/articles/{sku}/transactionsTransaction history
POST/BOOST/v3/transactionsCreate transaction

Orders

MethodPathDescription
POST/BOOST/v3/cim/ordersCreate order
GET/BOOST/v3/cim/ordersFind orders
GET/PUT/DELETE/BOOST/v3/cim/orders/{id}CRUD by ID
POST/BOOST/v3/cim/orders/{id}/orderLinesAdd order line
POST/BOOST/v3/wms/purchaseordersCreate purchase order

Invoices

MethodPathDescription
POST/BOOST/v3/cim/invoicesCreate invoice
GET/BOOST/v3/cim/invoicesFind invoices
GET/BOOST/v3/supplierinvoicesSupplier invoices

Files (MinIO)

MethodPathDescription
GET/BOOST/v3/files3List files
GET/BOOST/v3/entity/{id}/filesFiles by entity
POST/boost/v1/minio/uploadUpload file

Dynamic Endpoints

Additional endpoints are loaded from the boost_apifrontend MySQL database at startup:

  • apiBases — base path definitions
  • apiBaseVersions — API version configuration
  • apiEndpoints — endpoint method, path, queue, and handler mapping

Connection Management

  • Thread-local JMS connections, sessions, producers, and consumers
  • Connection pool with max 10 connections (JmsPoolConnectionFactory)
  • Hourly cleanup of stale thread-local resources
  • Shutdown hook for graceful connection closure

Dependencies

DependencyVersionPurpose
jersey-container-jetty-http3.1.9HTTP server + REST framework
qpid-jms-client2.6.1AMQP messaging
pooled-jms3.1.7JMS connection pooling
mysql-connector-java8.0.33MySQL driver
jedis5.2.0Redis client
minio8.5.8S3 file storage
commons-codec1.17.1Encoding utilities
jakarta.mail2.0.1Email utilities

Project Structure

src/main/java/com/luqon/portal/
├── api/
│   ├── app/
│   │   ├── RestServer.java                  # Entry point
│   │   ├── Application.java                # Server init, DI
│   │   ├── BOOSTAuthFilter.java            # JWT auth filter
│   │   ├── DynamicResourceRegistrator.java  # DB-driven endpoints
│   │   ├── DynamicRequestInflector.java     # HTTP→JMS handler
│   │   ├── CORSFilter.java
│   │   ├── RequestLoggingFilter.java
│   │   └── ResponseLoggingFilter.java
│   ├── controllers/
│   │   ├── PortalServiceV3.java            # Main REST endpoints
│   │   ├── PortalServiceV2.java
│   │   ├── PortalServiceV1.java
│   │   ├── MinioServiceV1.java             # File storage
│   │   └── NimposAPI.java                  # Payment processing
│   ├── services/
│   │   ├── ActiveMQService.java            # JMS communication
│   │   ├── RedisService.java               # Caching
│   │   └── LogBuilder.java                 # Structured logging
│   └── AuthenticationUtils.java
└── jwt/
    ├── AccessToken.java
    ├── HmacJsonWebToken.java
    └── JsonWebToken.java

Running

bash
java -cp target/PortalAPI-jar-with-dependencies.jar \
     com.luqon.portal.api.app.RestServer

Starts Jetty on http://localhost:8080.