private void addMessageToTraceRepository(Message<?> message) { Map<String, Object> trace = new LinkedHashMap<>(); trace.put("type", "text"); trace.put("direction", "out"); trace.put("id", message.getHeaders().getId()); trace.put("payload", message.getPayload().toString()); websocketTraceRepository.add(trace); }
protected void traceAction(String action) { String user = "******"; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { user = authentication.getName(); } Map<String, Object> trace = new LinkedHashMap<>(); trace.put("user", user); trace.put("action", action); traceRepo.add(trace); }