Question: I have this variable like so:

```
var htmlBody = "<table border = '1' cellspacing='0' align = 'center'><tr><th>Job #</th><th>Task</th><th>Date</th></tr></table>”;

```

which I will be using for to generate a mailto link:

```
window.location = "mailto:?subject=Schedule&body=" + htmlBody;

```

My question is, is it possible encode the html in my string for this purpose? So I do not have the html markup in the email body.

Thanks,

Answer: 
Your existing solution is best. Handing off to another thread will cause problems with offset management. Spring kafka allows you to run multiple threads in each instance, as long as you have enough partitions.
If your current approach works, just stick to it. It's the simple and elegant way to go.

You would only go to approach 2 in case you cannot for some reason increase the number of partitions but need higher level of parallelism. But then you have ordering and race conditions to worry about. If you ever need to go that route, I'd recommend the [akka-stream-kafka](https://doc.akka.io/docs/akka-stream-kafka/current/consumer.html) library, which provides facilities to handle offset commits correctly and to do what you need in parallel and then merge back into a single stream preserving the original ordering, etc. Otherwise, these things are error-prone to do yourself.