@Override public CodecType getCodec() { CodecType result; try { result = CodecType.valueOf(codec); } catch (Exception e) { return CodecType.Avro; } return result; }
public static void main(String[] args) throws IOException { CodecType codec = null; switch (args.length) { case 0: codec = CodecType.Avro; break; case 2: if ("-c".equals(args[0])) { codec = CodecType.valueOf(args[1]); break; } default: System.err.println("ERROR: invalid command line parameters; expected none or '-c <codec_name>"); System.exit(-1); } EurekaTransportConfig transportConfig = new BasicEurekaTransportConfig.Builder().withCodec(codec).build(); new EurekaCLI(transportConfig).readExecutePrintLoop(); }