Configuration of the EDA Server Connection

Configuration of the EDA Server Connection

To expose EDA (Energy Data Archive) vector values through SmartWeb (universal REST/CometD API, gRPC, OData), a connection from SmartWeb to the EDA server must be configured. SmartWeb uses the proprietary d2jeda library to talk to the EDA server.

[!WARNING] The SmartWeb platform version must match the EDA server version (the same d2jeda library version is shipped with both).

Direct connection to the EDA server

In DIRECT mode, SmartWeb actively opens connections to one or more EDA server endpoints. Multiple entries can be listed for redundancy and round-robin load balancing.

smartweb: edaConnection: connectionMode: DIRECT connections: - host: edaserver.example.com # DNS name or IP address port: 3130 watchdogFrequencySeconds: 30 # ping interval to keep TCP open through firewalls - host: edaserver2.example.com port: 3130 watchdogFrequencySeconds: 30

Property

Description

Property

Description

connectionMode

DIRECT — SmartWeb actively connects out to the EDA server.

connections[].host

Hostname or IP address of the EDA server.

connections[].port

TCP port the EDA server listens on.

connections[].watchdogFrequencySeconds

Ping interval in seconds; prevents NAT/firewalls from dropping idle TCP connections.

connections[].certificatePath

Optional path to the X.509 public certificate (.crt) for TLS-encrypted connections.

In DIRECT mode SmartWeb manages the EDA connections automatically: when a connection drops, SmartWeb retries with a one-minute timeout. EDA requests are distributed between connections in a round-robin fashion.

Reverse connection from the EDA server

In REVERSE mode SmartWeb opens a listening port; the EDA side connects to it. Because the EDA server cannot directly establish reverse connections, the Linux socat utility is typically used to bridge the two endpoints.

smartweb: edaConnection: connectionMode: REVERSE connections: - host: 172.16.1.179 # binding interface on the SmartWeb side port: 3130 watchdogFrequencySeconds: 30 certificatePath: config/cert/eda-server.crt # optional, for TLS

Encrypted (TLS) connection

For TLS-encrypted EDA communication, generate the EDA-side X.509 key pair (see the D2000 documentation for the EDA process), distribute the public part (.crt) to SmartWeb and reference it via certificatePath. Both DIRECT and REVERSE modes support TLS.

smartweb: edaConnection: connectionMode: DIRECT connections: - host: edaserver.example.com port: 3130 certificatePath: config/cert/eda-server.crt watchdogFrequencySeconds: 30

Reverse connection through socat

The EDA server cannot dial back into SmartWeb directly. The socat utility is used to bridge the EDA listening port and the SmartWeb listening port. The following systemd unit keeps socat permanently running — socat terminates when one of the connected sockets closes:

/etc/systemd/system/socat.service

[Unit] Description=socat bridge between EDA server and SmartWeb After=network.target [Service] ExecStart=/usr/bin/socat -d -d \ TCP:localhost:3121,forever,keepalive \ TCP:smartweb.example.com:3300,forever,keepalive Restart=always RestartSec=2 [Install] WantedBy=multi-user.target

Example: SmartWeb with direct EDA + gRPC

The full application.yaml snippet below configures both the D2000 JAPI connection (for archive data) and the EDA connection (for EDA vectors), and exposes a gRPC API on port 9090.

server: port: 8443 smartweb: edaConnection: connectionMode: DIRECT connections: - host: 172.30.30.10 port: 3121 connections: - host: 172.30.30.10 port: 3120 authentication: authModes: - AUTH_CREDENTIALS_IN_SESSION apiKeys: enabled: true application: grpcApi: configItems: - enabled: true host: "0.0.0.0" port: 9090 ssl: enabled: true keyStore: path: cert/keystore.p12 password: changeit keyAlias: smartweb clientAuth: OPTIONAL accessFilter: allowedD2EdaVectorReadCodes: ["*"] allowedD2EdaVectorUpdateCodes: ["*"]