DayTrader 7 ships with three pre-built Open LibertyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/WASdev/sample.daytrader7/llms.txt
Use this file to discover all available pages before exploring further.
server.xml configurations that cover every deployment scenario from local development to multi-server load testing. All three files live in daytrader-ee7/src/main/liberty/config/ and share an identical featureManager and JMS topology — the only difference between them is the database backend and, in the container variant, a handful of additional features.
Configuration files at a glance
| File | Database | When to use |
|---|---|---|
server.xml | Apache Derby (embedded) | Developer quickstart — no external database needed; the pre-populated Derby store at ${shared.resource.dir}/data/tradedb is used automatically |
server_db2.xml | External IBM DB2 (bare-metal or VM) | Performance and load testing; all DB2 connection properties are supplied via environment variables |
server_db2_container.xml | External IBM DB2 (container) | Container-based deployments; adds mpHealth-1.0 and transportSecurity-1.0 on top of the DB2 configuration |
Full server.xml (Derby / default)
The listing below is the verbatim content ofserver.xml as shipped in the repository.
Key sections explained
featureManager
Liberty’s feature system loads only the capabilities the application actually needs. DayTrader 7 requires exactly 13 features:| Feature | Purpose |
|---|---|
ejb-3.2 | Stateless and message-driven EJBs (Java EE 7 EJB Full profile) — hosts TradeSLSBBean and the order MDBs |
servlet-3.1 | HTTP Servlet container for TradeAppServlet, TradeConfigServlet, and TradeScenarioServlet |
jsf-2.2 | JavaServer Faces for the market-summary UI built with .xhtml Facelets |
jpa-2.1 | JPA entity persistence for AccountDataBean, QuoteDataBean, OrderDataBean, HoldingDataBean, and AccountProfileDataBean |
mdb-3.2 | Message-Driven Bean support for DTBroker3MDB (order processing) and TradeStreamerMDB (WebSocket price push) |
wasJmsServer-1.0 | Embedded Liberty JMS messaging engine — hosts TradeBrokerQueue and TradeTopicSpace in-process |
wasJmsClient-2.0 | JMS client API used by the application to send to the queue and publish to the topic |
cdi-1.2 | Contexts and Dependency Injection; provides @Inject across the web and EJB tiers |
websocket-1.1 | JSR-356 WebSocket endpoint (TradeWebsocket) that streams live quote price changes to browser clients |
concurrent-1.0 | JSR-236 Managed Threads used by the Async_ManagedThread order-processing mode |
jsonp-1.0 | JSON-P streaming API used when constructing the market-summary JSON payload |
beanValidation-1.1 | JSR-349 Bean Validation applied to JPA entity constraints |
localConnector-1.0 | Enables JMX-based local connection for server status and server dump tooling |
httpEndpoint
| Attribute | Value | Meaning |
|---|---|---|
host | * | Listen on all network interfaces |
httpPort | 9082 | Plain HTTP — primary benchmark port |
httpsPort | 9443 | TLS — active when transportSecurity-1.0 is loaded |
soReuseAddr | true | Allows the OS to immediately rebind the port after a server stop |
maxKeepAliveRequests | -1 | Unlimited keep-alive requests per connection (no forced reconnect overhead) |
soReuseAddr="true" is critical for benchmarking on Linux. Without it, the OS holds the port in TIME_WAIT for up to two minutes after a server stop, causing address already in use errors on rapid restarts between measurement runs.iiopEndpoint is also declared on ports 2809 (IIOP) and 2810 (IIOP/TLS) to support the optional remote EJB interface invocation path.
connectionManager (database pool)
| Attribute | Value | Effect |
|---|---|---|
maxPoolSize | 100 | Hard ceiling on concurrent database connections |
minPoolSize | 100 | Pool is pre-filled to 100 connections at startup — avoids ramp-up latency during benchmarks |
agedTimeout | -1 | Connections are never retired due to age |
maxIdleTime | -1 | Idle connections are never evicted |
connectionTimeout | 0 | Requests for a connection block without timeout (wait indefinitely) |
reapTime | -1 | The pool reaper thread is disabled |
purgePolicy | FailingConnectionOnly | On a connection error, only the failing connection is removed — the rest of the pool stays intact |
-1 gives maximum throughput at the cost of resource reclamation. This profile is designed for sustained load tests where the pool should stay fully warm for the entire run duration.
jdbcDriver and dataSource (Derby)
- JNDI name —
jdbc/TradeDataSource— looked up in application code viajava:comp/env/jdbc/TradeDataSource. isolationLevel—TRANSACTION_READ_COMMITTEDbalances consistency with concurrency; avoids dirty reads while allowing non-repeatable reads under concurrent workloads.statementCacheSize—60prepared statements are cached per connection (100 connections × 60 = up to 6,000 cached plans), minimising parse overhead under repeated workloads.createDatabase="create"— Derby will create the database directory at${shared.resource.dir}/data/tradedbon first use if it does not already exist.
server_db2.xml / server_db2_container.xml) the jdbcDriver block references db2jcc4.jar from ${shared.resource.dir}/db2jars, and the dataSource uses environment-variable substitution for host, port, database name, and credentials:
messagingEngine
wasJmsServer-1.0) hosts two destinations:
TradeBrokerQueue— point-to-point queue consumed byDTBroker3MDB. Used in theAsync_2-PhaseandAsync_ManagedThreadorder processing modes.TradeTopicSpace— publish/subscribe topic space. Quote price-change events are published here byTradeSLSBBean.publishQuotePriceChange()and consumed byTradeStreamerMDB, which forwards the payload to WebSocket clients.
JMS connection factories and destinations
Queue connection factory — TradeBrokerQCF
Queue connection factory — TradeBrokerQCF
jms/TradeBrokerQCF is the QueueConnectionFactory used to send order messages. deliveryMode="NonPersistent" means messages are held in memory only — they are lost on server restart but avoid the write amplification of persistent messaging, which suits benchmark workloads.Topic connection factory — TradeStreamerTCF
Topic connection factory — TradeStreamerTCF
jms/TradeStreamerTCF is the TopicConnectionFactory used to publish quote price-change events into TradeTopicSpace.JMS activation specs (MDB wiring)
JMS activation specs (MDB wiring)
eis/TradeBrokerMDB— activatesDTBroker3MDB, which dequeues order messages fromTradeBrokerQueueand completes them via JPA.eis/TradeStreamerMDB— activatesTradeStreamerMDB, which receives price-change topic messages and pushes them to WebSocket sessions viaTradeWebsocket.