public static void main(String[] args) {
configureLogging();
try {
int port = (args.length > 0) ? Integer.parseInt(args[0]) : 8888;
final Logger logger = Logger.getLogger(EndpointService.class.getName());
logger.log(Level.FINE, "Starting on port " + port);
HttpServer httpd = new NormalHttpServer(port,
new EndpointService(new Endpoint() {
public boolean acceptSubscriptionChange(String mode, String topic, String token, int leaseSeconds) {
System.out.println("Subscription change: "+mode+", "+topic+", "+token+", "+leaseSeconds);
return true;