.createReplicationSlot() .logical() .withSlotName(slotName) .withOutputPlugin(postgresPluginName) .make();
private void createRplSlot() throws SQLException { try { this.rplConnection.getReplicationAPI() .createReplicationSlot() .logical() .withSlotName(this.jdbcConfig.getSlotName()) .withOutputPlugin("test_decoding") .make(); } catch (SQLException e) { String msg = "ERROR: replication slot \"" + this.jdbcConfig.getSlotName() + "\" already exists"; if (msg.equals(e.getMessage())) { return; } throw e; } log.info("GetRplSlot success,slot:{}", this.slotName); }
.createReplicationSlot() .logical() .withSlotName(slotName) .withOutputPlugin(postgresPluginName) .make();