How to connect node-red with mqtt broker

I have corrected the flow formatting. You should have used the </> button at the top of the forum entry window. In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```) . The </> button provides those

``` 
   code goes here 
```

See this post for more details - How to share code or flow json