@@ -178,8 +178,8 @@ public class OpcUaClient {
178178 * Create an {@link OpcUaClient} configured with {@code config}.
179179 *
180180 * @param config the {@link OpcUaClientConfig}.
181- * @return an {@link OpcUaClient} configured with {@code config}.
182- * @throws UaException if the client could not be created (e.g. transport/encoding not supported) .
181+ * @return a new {@link OpcUaClient} configured with {@code config}.
182+ * @throws UaException if the client could not be created.
183183 */
184184 public static OpcUaClient create (OpcUaClientConfig config ) throws UaException {
185185 OpcTcpClientTransportConfig transportConfig = OpcTcpClientTransportConfig .newBuilder ().build ();
@@ -188,6 +188,27 @@ public static OpcUaClient create(OpcUaClientConfig config) throws UaException {
188188 return new OpcUaClient (config , transport );
189189 }
190190
191+ /**
192+ * Create an {@link OpcUaClient} configured with {@code config}.
193+ *
194+ * @param config the {@link OpcUaClientConfig}.
195+ * @param configureTransport a Consumer that receives an {@link
196+ * OpcTcpClientTransportConfigBuilder} that can be used to configure the transport.
197+ * @return a new {@link OpcUaClient} configured with {@code config}.
198+ * @throws UaException if the client could not be created.
199+ */
200+ public static OpcUaClient create (
201+ OpcUaClientConfig config , Consumer <OpcTcpClientTransportConfigBuilder > configureTransport )
202+ throws UaException {
203+
204+ var transportConfigBuilder = OpcTcpClientTransportConfig .newBuilder ();
205+ configureTransport .accept (transportConfigBuilder );
206+
207+ OpcTcpClientTransportConfig transportConfig = transportConfigBuilder .build ();
208+
209+ return new OpcUaClient (config , new OpcTcpClientTransport (transportConfig ));
210+ }
211+
191212 /**
192213 * Select the first endpoint with no security that allows anonymous connections and create an
193214 * {@link OpcUaClient} with the default configuration.
0 commit comments