Creating New Server Configuration Files

StreamBase provides the following ways to generate a new server configuration file:

  • In StreamBase Studio, for the current project

  • At the command prompt, using sbd -s

In Studio, you can elect to include a set of commented default configuration settings in your new configuration file. Studio's default is to create an empty, blank configuration file ready for you to add configuration elements. When using the sbd -s method, the new configuration file always includes commented default settings.

As described in the configuration introduction page, the preferred name for server configuration files is sbd.sbconf, which is the only configuration file name read by Studio when it launches applications. You can provide any basename for running sbd from the command prompt. You must use the filename extension .sbconf, which allows Studio to open the Configuration File Editor to edit the file.

New Configuration File in Studio

Follow these steps to generate a server configuration file in StreamBase Studio:

  1. Open the New StreamBase Server Configuration File wizard using one of the following methods:

    • Select FileNewStreamBase Server Configuration File.

    • Click the drop-down arrow next to the New toolbar button (), and select StreamBase Server Configuration File from the drop-down menu.

    • Right-click anywhere in the Project Explorer, and select NewStreamBase Server Configuration File from the context menu.

    • With the cursor in any Studio view, press Ctrl+N to open the New dialog. Select StreamBase Server Configuration File, and click Next.

    • With the cursor in any Studio view, press Alt+Shift+N to open the FileNew menu at the cursor location. Select StreamBase Server Configuration File, and click Next.

  2. In the New StreamBase Server Configuration File wizard, select the project folder where you want the configuration file to be created.

  3. Enter the file name to create. Use the default name sbd.sbconf unless you are generating an alternate configuration file for a specific purpose. The wizard enforces adding the .sbconf extension to any name you specify.

  4. Optional. Select the Populate with default configuration contents check box to start your configuration file with a commented default settings.

  5. Click Finish. A default configuration file is created in the specified project. Studio opens the new file in the Configuration File Editor.

    Note

    The Advanced button lets you create the new file as a link to an existing server configuration file anywhere in the file system. This feature is rarely useful for Studio applications.

If you do not include the commented default settings, Studio generates the following blank configuration file:

<?xml version="1.0" encoding="UTF-8"?>
 <streambase-configuration xmlns:xi="http://www.w3.org/2001/XInclude"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://www.streambase.com/schemas/sbconf/">

 </streambase-configuration> 

See HOCON Configuration File Editor to learn about the autocompletion features of the Configuration File Editor.

See StreamBase Server Configuration File XML Reference for the syntax of server configuration files.

Cloning Customized Configuration File Default Contents in Studio

If you select the Populate with default configuration contents check box in the configuration file wizard, (or run sbd -s at the command line), you can edit the resulting configuration file skeleton to include your own defaults. You can then replicate your custom defaults in subsequent configuration files the wizard generates.

To clone your defaults, place a copy of your edited configuration file with the name studio-sbd.sbconf in in your SBHOME/etc/ folder (where SBHOME is the root of your StreamBase installation). Then, when you use the Studio Configuration File Wizard (NewStreamBase Server Configuration File) and select the Populate with default configuration contents check box, the wizard will read and copy your file into your Studio project instead of generating a standard skeleton .sbconf file.

This only works when using the Configuration File Wizard. Your studio-sbd.sbconf file does not get reused if you create a new configuration file from the command line via sbd -s (see below).

Alternate Studio Methods

There are two alternate methods for creating a new server configuration file in Studio:

  • As part of creating a new StreamBase project

  • From the StreamBase context menu of a Studio project folder

When creating a new StreamBase project, as described on Creating a New StreamBase Project, you can opt to create a configuration file with default name sbd.sbconf, and can opt to include the commented default settings in the new file.

Studio also provides the following shortcut method:

  1. Select a project folder in the Project Explorer.

  2. Right-click, and from the context menu, select StreamBaseAdd Project Server Configuration File. This option is dimmed and unavailable if the selected project already contains a file named sbd.sbconf.

  3. Respond Yes or No to the Populate Server Configuration file with default contents? dialog.

  4. Studio creates, but does not automatically open, the requested configuration file in the selected project.

New Configuration File with sbd -s

In a UNIX terminal window or a StreamBase Command Prompt on Windows, you can generate a default server configuration file by redirecting the output of sbd -s to a file. For example, for UNIX:

cd /home/sbuser/streambase-studio-n.m-workspace/myProject
sbd -s > sbd.sbconf

For Windows:

cd "C:\Users\username\Documents\StreamBase Studio n.m Workspace\myProject"
sbd -s > sbd.sbconf

When using sbd -s, the generated file always contains commented default settings.