You can use Tunnel Service in the Tablestore console.
Create a tunnel
Preview data types in a tunnel
After you create a tunnel, you can simulate data consumption to preview the data types in the tunnel.
- For more information about how to write data to or delete data from tables in the console, see Read and write data in the console.
- Preview the data types in a tunnel
Enable data consumption for a tunnel
- Copy a tunnel ID from the tunnel list.
- Use Tunnel Service SDK in any programming language to enable data consumption for
the tunnel.
// Customize the data consumption callback or call the IChannelProcessor operation. Specify the process and shutdown methods. private static class SimpleProcessor implements IChannelProcessor { @Override public void process(ProcessRecordsInput input) { System.out.println("Default record processor, would print records count"); System.out.println( String.format("Process %d records, NextToken: %s", input.getRecords().size(), input.getNextToken())); try { // Simulate the processing of data consumption. Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } @Override public void shutdown() { System.out.println("Mock shutdown"); } } // We recommend that you share the same TunnelWorkerConfig. TunnelWorkerConfig provides more advanced parameters. TunnelWorkerConfig config = new TunnelWorkerConfig(new SimpleProcessor()); // Configure TunnelWorker and start automatic data processing. TunnelWorker worker = new TunnelWorker(tunnelId, tunnelClient, config); try { worker.connectAndWorking(); } catch (Exception e) { e.printStackTrace(); worker.shutdown(); tunnelClient.shutdown(); }
View data consumption logs
After data is consumed, you can view the consumption logs of incremental data, including consumption statistics and the latest synchronization time of incremental data in channels. You can also log on to the Tablestore console or call the DescribeTunnel operation to view the consumption latency and the number of consumed rows in each channel.