Tuesday, 4 November 2014

Starting a Pivotal GemFireXD server from Java

The FabricServer interface provides an easy way to start an embedded GemFire XD server process in an existing Java application.

In short code as follows will get you started. Use this in DEV/TEST scenarios not for production use.

package pivotal.au.gemfirexd.demos.startup;

import com.pivotal.gemfirexd.FabricServer;
import com.pivotal.gemfirexd.FabricServiceManager;

import java.sql.SQLException;
import java.util.Properties;

public class StartServer1
    public static void main(String[] args) throws SQLException, InterruptedException {
        // TODO Auto-generated method stub
        FabricServer server = FabricServiceManager.getFabricServerInstance();

        Properties serverProps = new Properties();
        serverProps.setProperty("server-groups", "mygroup");
        serverProps.setProperty("persist-dd", "false");


        server.startNetworkServer("", 1527, null);

        Object lock = new Object();
        synchronized (lock) {
            while (true) {


More Information


No comments: