setType() function is used to mark custom transaction as either web or background.
The default type is web.
Add dependency before starting with the api.
pom.xml
Java Agent API
Set type - Java Application Performance Monitoring
A function that helps you to set a type for new transactions. Learn more about its functionality and start monitoring your services.