Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8042423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:34:26+00:00 2026-06-05T04:34:26+00:00

We are using an embedded Glassfish Server in our testing environment. We use the

  • 0

We are using an embedded Glassfish Server in our testing environment. We use the org.glassfish.embeddable.CommandRunner interface to execute administrative tasks (i.e., what we do with asadmin with a standard standalone Glassfish server)

Example:

GlassFish glassfish = GlassFishRuntime.bootstrap( bp ).newGlassFish( gfp );
CommandRunner commandRunner = glassfish.getService( CommandRunner.class );
commandRunner.run(
  "create-jms-resource",
  "--restype",
  "javax.jms.Queue",
  "SOME_QUEUE_NAME"
);

Now on the command line I am able to set queue options with imqcmd. For example

imqcmd -u admin -passfile ../password.txt update dst -n SOME_QUEUE_NAME -t q -o maxBytesPerMsg=-1 -f

Is there a way to achieve the same with an embedded Glassfish server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:34:27+00:00Added an answer on June 5, 2026 at 4:34 am

    Instead of using imqcmd, you can use the asadmin subcommand create-jmsdest to create a JMS physical destination.

    From the documentation on create-jmsdest:

    Typically, you use the create-jms-resource subcommand to create a JMS destination resource that has a Name property that specifies the physical destination. The physical destination is created automatically when you run an application that uses the destination resource. Use the create-jmsdest subcommand if you want to create a physical destination with non-default property settings.

    If you do not specify a Name property for create-jms-resource, the name of the physical destination has the same name as the destination resource (replacing any forward slash in the JNDI name with an underscore).

    Thus, the asadmin commands you want to run are for example:

    create-jms-resource --restype javax.jms.Queue org/example/foo/SomeQueue
    create-jmsdest --desttype queue --property maxBytesPerMsg=-1:maxTotalMsgBytes=-1 org_example_foo_SomeQueue
    

    Note that (unlike imqcmd update dst) create-jmsdest does not update the properties if the resource already exists. Therefore, you should not start your application inbetween the two commands, otherwise the resource is automatically created with default properties.

    If you have to update properties, you can remove the physical destination first using e.g. asadmin delete-jmsdest org_example_foo_SomeQueue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I develop a Webservice using Netbeans 6.9 and I use an embedded glassfish server
I would like to use org.glassfish.api.embedded in my Java application so that I can
So, I am running a web server using embedded jetty and the maven app-assembler
I am using the Maven Embedded Glassfish Plugin and it works great, but unfortunately
is there any way to avoid this when using embedded web server in windows?
I am using embedded Jetty to launch a webapp and I use JSP pages
I'm using Embedded Glassfish to do some In-Container-Tests with Arquillian. Now, when my test
I'm trying to run a simple jsf-2.0 tutorial using embedded glassfish 3.0 and keep
how can one activate JMX in embedded glassfish (using maven-embedded-glassfish-plugin)?
I'm running Glassfish 3.1-SNAPSHOT as of today (2010-11-12). I'm using the embedded EJBContainer. On

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.