Encrypting and decrypting messages with Spring Kafka

╄→尐↘猪︶ㄣ 提交于 2021-02-11 14:56:43

问题


I am using Spring Kafka and one of the topics contains messages with personal data. Is there any way I can configure Spring Kafka to automatically encrypt messages in a Producer/decrypt messages in a consumer or would I have to do it manually?


回答1:


There is nothing built into Spring or Kafka (although you can use SSL on the wire to prevent snooping.

For application-level encryption/decryption, you would need to implement it.

You can separate the concern from your business logic by using a ProducerInterceptor and ConsumerInterceptor (Kafka) or RecordInterceptor (Spring).



来源:https://stackoverflow.com/questions/58717351/encrypting-and-decrypting-messages-with-spring-kafka

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!