You have to pass an exam, same as a public servant, and the number of positions is limited. But you don't have a regular salary like any other public servant: you set up a private office and get the money directly from your clients.
The price for the actions is regulated but it's high, and the number of licenses is limited, so generally they have hefty salaries, specially compared to the rest of the public servants and the mean of the population.
Their salary can be very variable based on location (as you get the money directly from your clients), but it's said to typically be from 100K to 200K€