type=page
status=published
title=delete-jms-resource
next=delete-jndi-resource.html
prev=delete-jms-host.html
~~~~~~

= delete-jms-resource

[[delete-jms-resource-1]][[GSRFM00092]][[delete-jms-resource]]

== delete-jms-resource

Removes a JMS resource

[[sthref809]]

=== Synopsis

[source]
----
asadmin [asadmin-options] delete-jms-resource [--help]
[--target target]
jndi_name
----

[[sthref810]]

=== Description

The `delete-jms-resource` subcommand removes the specified Java Message
Service (JMS) resource. Ensure that you remove all references to this
resource before executing this subcommand.

This subcommand is supported in remote mode only. Remote `asadmin`
subcommands require a running domain administration server (DAS).

[[sthref811]]

=== Options

asadmin-options::
  Options for the `asadmin` utility. For information about these
  options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page.
`--help`::
`-?`::
  Displays the help text for the subcommand.
`--target`::
  Deletes the JMS resource only from the specified target. Valid values
  are as follows:
+
[NOTE]
====
Resources are always created for a domain as a whole but are only
active for targets for which a `<resource-ref>` has been created using
the `--target` option when the resource was created. This means that
deleting a resource only deletes the `<resource-ref>` element for the
specified `--target`, and does not delete the resource from the domain
as a whole unless `domain` is specified as the `--target` for the
deletion.
====

  `server`;;
    Deletes the JMS resource from the default server instance. This is
    the default value.
  `domain`;;
    Deletes the JMS resource from the domain.
  cluster-name;;
    Deletes the JMS resource from every server instance in the specified
    cluster.
  instance-name;;
    Deletes the JMS resource from the specified server instance.

[[sthref812]]

=== Operands

jndi_name::
  The JNDI name of the JMS resource to be deleted.

[[sthref813]]

=== Examples

[[GSRFM560]][[sthref814]]

==== Example 1   Deleting a JMS destination resource

The following subcommand deletes the JMS destination resource named
`jms/MyQueue`.

[source]
----
asadmin> delete-jms-resource jms/MyQueue
Administered object jms/MyQueue deleted.
Command delete-jms-resource executed successfully.
----

[[sthref815]]

=== Exit Status

0::
  subcommand executed successfully
1::
  error in executing the subcommand

[[sthref816]]

=== See Also

link:asadmin.html#asadmin-1m[`asadmin`(1M)]

link:create-jms-resource.html#create-jms-resource-1[`create-jms-resource`(1)],
link:list-jms-resources.html#list-jms-resources-1[`list-jms-resources`(1)]


